From 6c8324d2396e7698296bbecf376a4a647b258057 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Wed, 2 Jun 2021 10:42:23 -0400 Subject: Convert to standardrb (#156) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - I mostly don’t care about this, but there are a couple of things that Standard does that I disagree with. They are inherited from Rubocop, but Standard fixes many of Rubocop’s nonsense rules. - Array literal wrappers %i[], %w[], etc. are just ugly and never should have become any sort of standard. I would be happier if this part of standard were just completely disabled, because it‘s unnecessary and wrong. - Quote literals having to be %q() is equally wrong. I’ve avoided the issue here because the generated gemspec uses both "unnecessary" quote literals (it’s necessary if I say it’s necessary) and the wrong wrappers (I wouldn’t use %q<>, but this is generated code). - I still think that short hashes can be `{ foo: "bar" }`, but I’m mostly using Elixir these days, so I don’t mind `%{foo: "bar"}`, so I can get used to it in Ruby. It still feels wrong, almost 20 years in. - There are semantic differences between and / &&, or / ||, but in some cases the reformatted code is substantially _worse_ to read. Again, I mostly don’t _care_ about this difference, but Rubocop’s insistence is silly; these should only be replaced where there _is_ ambiguity. - Replacing `x = foo or next` should never be replaced with `(x = foo) || next`. That’s replacing something that is somewhat readable with something damned-near unreadable. Both should be replaced with: ```ruby x = foo next unless x ``` - YAML.safe_load works differently between Psych 2.x and Psych 3.x, so some updates have been made to make that work cleanly. Overall, this introduces a lot of churn, but I think will be easier to deal with updates to `standardrb` instead of the rapid churn that has been Rubocop. --- .standard.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .standard.yml (limited to '.standard.yml') diff --git a/.standard.yml b/.standard.yml new file mode 100644 index 0000000..8ae76a7 --- /dev/null +++ b/.standard.yml @@ -0,0 +1,4 @@ +parallel: true +ruby_version: 2.0 +ignore: + - 'mime-types.gemspec' -- cgit v1.2.1