4

I'm using ActiveAdmin, where the DSL predisposes you to forming large blocks. Thus, rubocop says:

Block has too many lines

I might consider some config for ActiveAdmin that will globally affect all of its registries, but I'd ideally put the config in the rubocop dotfile.

Community
  • 1
  • 1
New Alexandria
  • 6,951
  • 4
  • 57
  • 77

1 Answers1

7

You can disable a single cop for a single directory or specific files. Say, in your example, you want to exclude ActiveAdmin files from being inspected by Metrics/BlockLength, and your files are located in app/admin, you add this to your .rubocop.yml:

Metrics/BlockLength:
  Exclude:
    - 'app/admin/**/*'

Note that this will override the default excludes (rake and spec files.) If you still want them excluded as well, you'll need to add them to your configuration:

Metrics/BlockLength:
  Exclude:
    - 'app/admin/**/*'
    - 'Rakefile'
    - '**/*.rake'
    - 'spec/**/*.rb'
Drenmi
  • 8,492
  • 4
  • 42
  • 51