Skip to content

Danger: Comment to encourage developers to fix RuboCop offenses

Problem

We have a lot of RuboCop offenses which are currently silenced/excluded via .rubocop_todo/**/*.yml.

Proposed solution

On changed files, let Danger detect the 👮 rules where these files are currently excluded and post a comment on the MR. This should encourage developers to fix pending offenses while changing these files anyway. Highlight cop rules which could be fixed via RuboCop's Auto Correct feature.

Perhaps we could also link to development guidelines https://docs.gitlab.com/ee/development/rubocop_development_guide.html#reveal-existing-rubocop-exceptions so more folks have RuboCop TODOs reveal locally.

Edited by Peter Leitzen