Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rubocop: Set inherit_mode: merge for Excludes #1680

Merged
merged 1 commit into from
Mar 10, 2020
Merged

Conversation

issyl0
Copy link
Contributor

@issyl0 issyl0 commented Mar 9, 2020

  • 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


Visual regression results:
https://government-frontend-pr-[THIS PR NUMBER].surge.sh/gallery.html

- 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
@bevanloon bevanloon temporarily deployed to government-f-rubocop-ym-ce3pem March 9, 2020 16:54 Inactive
@issyl0 issyl0 merged commit bdae5f1 into master Mar 10, 2020
@issyl0 issyl0 deleted the rubocop.yml-inheritance branch March 10, 2020 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants