Skip to content

RuboCop TODO formatter: Retain HAML exclusions

Peter Leitzen requested to merge pl-rubocop-todo-remain-haml-exclusions into master

What does this MR do and why?

HAML files (ending with .html.haml.rb) added (manually) to .rubocop_todo/**/*.yml now are retained and not removed.

This is useful because haml-lint (which use RuboCop rules) cannot exclude HAML files per RuboCop. So, we tend to disable whole cop rules in haml-lint.yml.

With this change we can now start enabling "temporarily" disabled cop rules in add HAML files as TODOs.

As an example, this MR also enables 👮 Gitlab/FeatureAvailableUsage and excludes HAML files in .rubocop_todo/gitlab/feature_available_usage.yml.

Done via:

  1. Enable cop rule in .haml-lint.yml
  2. bundle exec haml-lint --parallel > todos
  3. rg -r " - '\$1.rb'" -o "^([^:]+)" todos | sort | uniq >> .rubocop_todo/gitlab/feature_available_usage.yml
  4. bundle exec rake rubocop:todo:generate[Gitlab/FeatureAvailableUsage]

See #415330

How to set up and validate locally

bundle exec haml-lint --parallel
# no offenses

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports