4 ms·
> 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 Ruboco
by lloeki 2y ago
> 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#configurable-attributes-43 https://docs.rubocop.org/rubocop/cops_style.html#configurabl...