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 b26a367 commit 60e9f36
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ inherit_gem:
rubocop-govuk:
- config/default.yml
- config/rails.yml

inherit_mode:
merge:
- Exclude

0 comments on commit 60e9f36

Please sign in to comment.