diff options
| author | Maxime Dénès | 2017-11-06 11:20:16 +0100 |
|---|---|---|
| committer | Maxime Dénès | 2017-11-06 11:20:16 +0100 |
| commit | 54057085f18fbd4c1cb0f0f01c03c08a8cc541c3 (patch) | |
| tree | acc29aefbb91c65f4d23d1083e0f423ed8047504 /dev/tools | |
| parent | f281a8a88e8fc7c41cc5680db2443d9da33b47b7 (diff) | |
| parent | 7bd0fc03e5656e6672e8329b070ca9bda88d6b99 (diff) | |
Merge PR #1139: Add a linter.
Diffstat (limited to 'dev/tools')
| -rwxr-xr-x | dev/tools/check-eof-newline.sh | 9 | ||||
| -rwxr-xr-x | dev/tools/should-check-whitespace.sh | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/dev/tools/check-eof-newline.sh b/dev/tools/check-eof-newline.sh new file mode 100755 index 0000000000..1c578c05ce --- /dev/null +++ b/dev/tools/check-eof-newline.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if [ -z "$(tail -c 1 "$1")" ] +then + exit 0 +else + echo "No newline at end of file $1!" + exit 1 +fi diff --git a/dev/tools/should-check-whitespace.sh b/dev/tools/should-check-whitespace.sh new file mode 100755 index 0000000000..8159506b41 --- /dev/null +++ b/dev/tools/should-check-whitespace.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# determine if a file has whitespace checking enabled in .gitattributes + +git check-attr whitespace -- "$1" | grep -q -v 'unspecified$' |
