Created
August 3, 2022 15:29
-
-
Save YarikST/b5179f0b192bdc67c1194f44f56509a4 to your computer and use it in GitHub Desktop.
Run Rubocop only on changed files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Create cop.diff file. On theses files we would run Rubocop | |
git diff-tree -r --no-commit-id --name-only --diff-filter=dr head origin/master > cop.diff | |
diff-filter - allow to filter some records, we dont need deleted file | |
origin/master - is a target for comparison | |
2. Run Rubocop | |
cat cop.diff | xargs bundle exec rubocop -A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment