You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running rubocop --auto-gen-config with default settings on a large legacy project, the generated .rubocop-todo.yml does not correctly suppress all found offenses, so that a subsequent RuboCop inspection using the generated config does not pass.
The problem seems to be with the Layout/SpaceBeforeBlockBraces cop, for which the following unexpected config entry is generated:
This generated config is particularly strange since our recommended (and mostly followed) Ruby code style in fact mandates spaces before both empty and non-empty block braces, although we do have a few dozen Ruby code files (out of more than 2000) that currently violate this rule.
Manually editing .rubocop-todo.yml to replace EnforcedStyleForEmptyBraces: no_space with Enabled: false does make a subsequent rubocop inspection pass, but rubocop --regenerate-todo still undoes this manual change.
RuboCop version
I am using RuboCop 1.60.1 on JRuby 9.4.5.0. Running rubocop -V prints:
…kBraces
The `Layout/SpaceBeforeBlockBraces` cop has two separate style parameters,
`EnforcedStyle` and `EnforcedStyleForEmptyBraces`. The logic for generating
`Enabled: false` when opposite styles are detected during `--auto-gen-config`
was implemented for `EnforcedStyle`, but it was missing for
`EnforcedStyleForEmptyBraces`.
When running
rubocop --auto-gen-config
with default settings on a large legacy project, the generated.rubocop-todo.yml
does not correctly suppress all found offenses, so that a subsequent RuboCop inspection using the generated config does not pass.The problem seems to be with the
Layout/SpaceBeforeBlockBraces
cop, for which the following unexpected config entry is generated:This generated config is particularly strange since our recommended (and mostly followed) Ruby code style in fact mandates spaces before both empty and non-empty block braces, although we do have a few dozen Ruby code files (out of more than 2000) that currently violate this rule.
Manually editing
.rubocop-todo.yml
to replaceEnforcedStyleForEmptyBraces: no_space
withEnabled: false
does make a subsequentrubocop
inspection pass, butrubocop --regenerate-todo
still undoes this manual change.RuboCop version
I am using RuboCop 1.60.1 on JRuby 9.4.5.0. Running
rubocop -V
prints:The text was updated successfully, but these errors were encountered: