summaryrefslogtreecommitdiff
path: root/lib/mime-types.rb
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2021-03-24 14:30:47 -0400
committerAustin Ziegler <austin@zieglers.ca>2021-03-24 15:08:54 -0400
commit9c33de4a445745f55c7efd5990585d93b2bf423f (patch)
tree74dc0c2e7ddbb1b92abc5264c5984b1cad399be5 /lib/mime-types.rb
parentb8db65ac00b8f23d4274ed47aada475a65cc24d0 (diff)
downloadmime-types-9c33de4a445745f55c7efd5990585d93b2bf423f.tar.gz
Convert to standardrbstandardrb
- 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 ``` 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.
Diffstat (limited to 'lib/mime-types.rb')
-rw-r--r--lib/mime-types.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mime-types.rb b/lib/mime-types.rb
index 5c7dd73..dcb87cf 100644
--- a/lib/mime-types.rb
+++ b/lib/mime-types.rb
@@ -1,3 +1,3 @@
# frozen_string_literal: true
-require 'mime/types'
+require "mime/types"