summaryrefslogtreecommitdiff
path: root/lib/tasks/rubocop.rake
blob: 8c5edb5de8a3dd7d491587b85c13625c740c3fee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

unless Rails.env.production?
  require 'rubocop/rake_task'

  RuboCop::RakeTask.new

  namespace :rubocop do
    namespace :todo do
      desc 'Generate RuboCop todos'
      task :generate do # rubocop:disable Rails/RakeEnvironment
        require 'rubocop'

        options = %w[
          --auto-gen-config
          --auto-gen-only-exclude
          --exclude-limit=100000
          --no-offense-counts
        ]

        RuboCop::CLI.new.run(options)
      end
    end
  end
end