[go: up one dir, main page]

Explore adding a discussion thread on code that disables rubocop rules

A lot of times Rubocop rules are disabled in line with:

  • # rubocop:disable some_cop
  • # rubocop :disable some_cop
  • # rubocop:todo some_cop
  • or other variation

Some times there is no context given as to why or warned about, which doesn't really follow our guidelines https://docs.gitlab.com/ee/development/rubocop_development_guide.html

By default, we should not disable a RuboCop rule inline, because it negates agreed-upon code standards that the rule is attempting to apply to the codebase.

If you must use inline disable, provide the reason on the MR and ensure the reviewers agree before merging.

Solution

add an automated conversation on a line of code that disables a rubocop rule inline

test TBD

Edited by Peter Leitzen