I'm wondering if there are a way of specifying different parameters for different directories.
For instance, I would like RuboCop to be more gentle with my tests. Is there a way to re-write this setup?
Metrics/AbcSize:
Max: 20
Exclude:
- 'spec/**/*'
Metrics/AbcSize:
Max: 30
Include:
- 'spec/**/*'
Right now I'm getting .rubocop.yml:X: 'Metrics/AbcSize' is concealed by line Y
Update:
Ended up with two .rubocop.yml
files:
[project-root]/.rubocop.yml
:
Metrics/AbcSize:
Max: 20
[project-root]/spec/.rubocop.yml
:
inherit_from: ../.rubocop.yml
Metrics/AbcSize:
Max: 30
Create separate .rubocop.yml
in /spec
with desired rules. Rubocop will pick it up
RuboCop will start looking for the configuration file in the directory where the inspected file is and continue its way up to the root directory.
Ref https://rubocop.readthedocs.io/en/latest/configuration/
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