Search code examples
ruby-on-railsrubyformattingrubocoplinter

rubocop_todo / how to re-include specific files for rules


Having the following part in rubocop_todo.yml

Metrics/AbcSize:
  Max: 749

What i'd like to do, would be to add specific files that would have to respect the default (in other words : 'every files can reach mega-high Metrics/AbcSize, but the ones i'd like to improve)

Tried the following :

Metrics/AbcSize:
  Max: 749
  Exclude:
    - app/controllers/conversations_controller.rb

But nothing happens. Using Includes, same

I feel like the problem should be taken with another approach; but still I'm a bit stuck

thx in advance


Solution

  • I wish you could use formatting in comments... but yeah like Taryn East said, make sure your rubocop.yml is in the root. For comparison's sake, here's some lines from my file:

    AllCops:
      Exclude:
        - bin/**/*
        - db/*
        - spec/factories/**/*
        - tmp/**/*
        - vendor/**/*