Commit 6f2a1ede authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'pl-rake-rubocop-todo-task' into 'master'

Add rake task `rubocop:todo:generate`

See merge request gitlab-org/gitlab!69112
parents e25d639c 06920cf9
......@@ -177,11 +177,10 @@ This ensures that our list isn't mistakenly removed by another auto generation o
the `.rubocop_todo.yml`. This also allows us greater visibility into the exceptions
which are currently being resolved.
One way to generate the initial list is to run the `todo` auto generation,
with `exclude limit` set to a high number.
One way to generate the initial list is to run the Rake task `rubocop:todo:generate`:
```shell
bundle exec rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit=100000
bundle exec rake rubocop:todo:generate
```
You can then move the list from the freshly generated `.rubocop_todo.yml` for the Cop being actively
......
......@@ -188,6 +188,17 @@ Alternatively you can use the following on each spec run,
bundle exec spring rspec some_spec.rb
```
## Generate initial RuboCop TODO list
One way to generate the initial list is to run the Rake task `rubocop:todo:generate`:
```shell
bundle exec rake rubocop:todo:generate
```
See [Resolving RuboCop exceptions](contributing/style_guides.md#resolving-rubocop-exceptions)
on how to proceed from here.
## Compile Frontend Assets
You shouldn't ever need to compile frontend assets manually in development, but
......
......@@ -4,4 +4,21 @@ unless Rails.env.production?
require 'rubocop/rake_task'
RuboCop::RakeTask.new
namespace :rubocop do
namespace :todo do
desc 'Generate RuboCop todos'
task :generate do
require 'rubocop'
options = %w[
--auto-gen-config
--auto-gen-only-exclude
--exclude-limit=100000
]
RuboCop::CLI.new.run(options)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment