Skip to content

Commit

Permalink
rubocop: Set inherit_mode: merge for Excludes
Browse files Browse the repository at this point in the history
- We found that for apps that used Ruby-only cops, the recent changes in
  gem version 3.1.0 to exclude `bin/` files from linting worked fine.
- For apps that used Rails cops as well, the changes didn't work for
  `bin/` but they did work for `db/schema.rb` which is excluded from
  linting in `config/rails.yml`.
- This is because RuboCop by default *overwrites* any previous
  definitions of a config option when it detects a later one:
  https://rubocop.readthedocs.io/en/latest/configuration/#merging-arrays-using-inherit_mode.
- Unfortunately, we'll have to specify this `inherit_mode` stanza in
  every app.

https://trello.com/c/i72oq9Xa/1810-fix-rubocop-config-file-inheritance-in-all-the-apps
  • Loading branch information
issyl0 committed Mar 9, 2020
1 parent 180338e commit 7b133b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# .rubocop.yml
inherit_gem:
rubocop-govuk:
- config/default.yml

inherit_mode:
merge:
- Exclude

0 comments on commit 7b133b7

Please sign in to comment.