RuboCop: Investigate silenced offenses for Lint/RedundantCopDisableDirective
Problem
In !99217 (merged) we've enabled Lint/RedundantCopDisableDirective
in "grace period".
This caused rake rubocop:check:graceful
to silences offenses like https://gitlab.com/gitlab-org/gitlab/-/jobs/3115984225
Proposed solution
Investigate silenced offenses and re-enable this rule again in "grace period".
Make sure that bundle exec rake rubocop:check:graceful
passes.
Implementation Guide
-
Enable
Lint/RedundantCopDisableDirective
by removingEnabled: false
(plus comments above) in.rubocop_todo/lint/redundant_cop_disable_directive.yml
. -
Enable "grace period" permanently in
.rubocop.yml
by adding
Lint/RedundantCopDisableDirective:
# Permanent "grace period" to silence new offenses on CI
# See https://gitlab.com/gitlab-org/gitlab/-/issues/376133
Details: grace period
- Autocorrect all offenses (will be
Lint/RedundantCopDisableDirective
only) via
bundle exec rubocop --parallel --autocorrect-all
# Takes a long time
-
Drop autocorrects for cops other than
Lint/RedundantCopDisableDirective
(if any) -
Create an MR
Edited by Peter Leitzen