💎🚀 Standard Ruby 1.40.0

A whole slew of bugfixes here, and one new rule... which we opted not to enable 🖖

https://rubygems.org/gems/standard/versions/1.40.0

#ruby #rubyonrails #programming #softwareengineering #codequality

standard | RubyGems.org | your community gem host

@cam +1 for not enabling the Gemspec/AddRuntimeDependency rule by default. A #Gemspec doesn't have the same rich grammar as a #Bundler #Gemfile, so by definition anything not a development dependency is a runtime dependency. There's no need to be needlessly verbose about it, so kudos on that choice! 👏

@todd_a_jacobs @cam now I’m worried you won’t like this reply 😅. The rule, if enabled, would have forced everything to add-dependency (thereby removing the longer form runtime alias).

My rationale is that standard doesn’t take a position on most methods that are simply aliases (see enumerable api cops). Similarly to Matz and Ruby in general, authors may choose aliases for their own purposes.

@todd_a_jacobs @cam OTOH, if this cop had included a ‘consistent’ option (whereby standard doesn’t care which you use, but you’re not allowed to use both in the same file), I would have been in favor of that. Alas, they don’t have that option (yet)
@jasonkarns @cam You're right: sometimes it doesn't matter, and aliases can often be redefined. Usually there's some semantic purpose, though. For example, I suppose I just assumed that standardrb preferred double-quotes because they're more visible and easier to use to interpolate instead of having to change the quote style first. That's *my* rationale anyway, and why I prefer double to single quotes except when absolutely needed. (1/2)

@jasonkarns @cam (2/2)
This *might* be a case where semantic clarity has value, though, which is why I thought :add_runtime_dependency & :add_development_dependency had viable arguments for being explicit even though I prefer the simpler form for runtime dependencies. Now I'm not sure *why* you made the decision, even though I suppose I'm still saying I agree with it for my own reasons.

:add_dependency & :add_development_dependency seem sufficient but may change *your* semantic intent. YMMV.

@todd_a_jacobs @cam yep, lots of nuance. If you omit dev deps from gemspec, add-dep is sufficient. If you want explicit distinction, you can choose to be explicit with the full names. This didn’t seem like a thing that really needed forcing to one style.

Appreciate you weighing in!