Fix shell script list computation to exclude files not in git.

This fixes an issue where the next commit's no-newline-and-end-of-file
check was incorrectly firing on tools/phantomjs.
This commit is contained in:
Tim Abbott
2016-03-17 23:02:28 -07:00
parent d72b8b83f7
commit 3a46bae542

View File

@@ -80,7 +80,7 @@ for filepath in files:
by_lang[exn].append(filepath)
by_lang['.sh'] = [_f for _f in map(str.strip, subprocess.check_output("grep --files-with-matches '#!.*\(ba\)\?sh' $(find scripts/ tools/ bin/ -type f | grep -v [.])", shell=True).split('\n')) if _f]
by_lang['.sh'] = [_f for _f in map(str.strip, subprocess.check_output("grep --files-with-matches '#!.*\(ba\)\?sh' $(git ls-tree --name-only -r HEAD scripts/ tools/ bin/ | grep -v [.])", shell=True).split('\n')) if _f]
# Invoke the appropriate lint checker for each language,
# and also check files for extra whitespace.