This file contains 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
#!/bin/sh | |
# This script only checks the total number of offenses in modified files. | |
# If you removed old offenses, it may not warn you about new ones. | |
# Other scripts check all modified files for offenses. | |
# They don't ignore old offenses. | |
NUMBER_BEFORE=`git diff --cached --diff-filter=CMRTUXB --name-only -- '*.rb' | sed 's/^\(.*\)$/HEAD:\1/' | xargs git show | rubocop -s head -f o | tail -n 2 | head -n 1 | cut -d ' ' -f 1` | |
NUMBER_NOW=`git diff --cached --diff-filter=ACMRTUXB --name-only -- '*.rb' | xargs cat | rubocop -s now -f o | tail -n 2 | head -n 1 | cut -d ' ' -f 1` |