News for hackers. Stuff that matters.
Re:Utilities for refactoring and upgrading Ruby code based o... by lloeki on Tuesday May 07, 2024 @02:51AM (#40283059)
> you can't specify which style in rubocop you want code refactored to

You can, with the per-cop `EnforcedStyle` configuration key.

I hate browsing the Rubocop doc so I just put the cop name with that config key set to a bogus value, then Rubocop yells at me about the invalid value and lists the available ones.

There can be more than EnforcedStyle, e.g see these for Style/HashSyntax (scroll up for examples), which autocorrect will respect:

https://docs.rubocop.org/rubocop/cops_style.html#configurabl...

There are no comments on this comment yet.