chore(elvis): Skip deleted files and non .erl files

This commit is contained in:
Zaiming Shi 2020-12-18 22:57:03 +01:00
parent 824cf26185
commit fe675905a6
1 changed files with 10 additions and 2 deletions

View File

@ -22,8 +22,16 @@ git_diff() {
}
bad_file_count=0
for n in $(git_diff); do
if ! ./elvis rock "$n"; then
for file in $(git_diff); do
if [ ! -f "$file" ]; then
# file is deleted, skip
continue
fi
if [[ $file != *.erl ]]; then
# not .erl file
continue
fi
if ! ./elvis rock "$file"; then
bad_file_count=$(( bad_file_count + 1))
fi
done