RuboCop TODO formatter: Retain HAML exclusions
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:
- Enable cop rule in
.haml-lint.yml
bundle exec haml-lint --parallel > todos
rg -r " - '\$1.rb'" -o "^([^:]+)" todos | sort | uniq >> .rubocop_todo/gitlab/feature_available_usage.yml
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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Peter Leitzen