Unable to re-generate all RuboCop TODOs
The following discussion from !89590 (merged) should be addressed:
-
@splattael started a discussion: I found an issue with this line when reg-generating RuboCop TODOs:
$ bundle exec rake rubocop:todo:generate Generating RuboCop TODOs with: rubocop --parallel --format RuboCop::Formatter::TodoFormatter This might take a while... Configuration file not found: /home/peter/devel/gitlab/gdk/gitlab/.rubocop_todo/gitlab/namespaced_class.yml
This makes sense because this rake task deletes all TODO in
.rubocop_todo/**/*.yml
first and then runs RuboCop which fails to find TODO YML.I see two options:
- Revert this MR
- Check existence of this file via ERB
diff --git a/.rubocop.yml b/.rubocop.yml index e4b46121df6..5819385b63b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -14,7 +14,7 @@ inherit_from: - '.rubocop_todo.yml' <% end %> <%# See https://gitlab.com/gitlab-org/gitlab/-/issues/321982#rubymine-note for context on why namespaced_class has special handling here %> - - ./.rubocop_todo/gitlab/namespaced_class.yml + - <%= './.rubocop_todo/gitlab/namespaced_class.yml' if File.exist?(File.join(Dir.pwd, '.rubocop_todo/gitlab/namespaced_class.yml')) %> - ./rubocop/rubocop-migrations.yml - ./rubocop/rubocop-usage-data.yml - ./rubocop/rubocop-code_reuse.yml
I slightly prefer option 1. but happy to discuss this in an issue.