I'm using ActiveAdmin, where the DSL predisposes you to forming large blocks. Thus, rubocop says:
Block has too many lines
I do not want to add a per-file ignore instructions, (docs):
# rubocop:disable BlockLength
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.
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With