Skip to content

Commit

Permalink
chore: add --force-exclusion option (#6535)
Browse files Browse the repository at this point in the history
The pre-commit hook would format event those files excluded in the config. This is because the files were passed as args instead of the linter running on the entire project. When this happens, the exclude is not respect.

The --force-exclusion flag instructs our machine overlords to force exlucde files specified in the configuration Exclude even if they are explicitly passed as arguments.
  • Loading branch information
scmmishra committed Feb 24, 2023
1 parent c998c84 commit 76650c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Expand Up @@ -5,7 +5,7 @@
npx --no-install lint-staged

# lint only staged ruby files
git diff --name-only --cached | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop -a
git diff --name-only --cached | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop --force-exclusion -a

# stage rubocop changes to files
git diff --name-only --cached | xargs git add

0 comments on commit 76650c8

Please sign in to comment.