Skip to content

Commit fa73d05

Browse files
committed
Exclude binaries from Travis CI formatting tests of this repo
1 parent c8decfa commit fa73d05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ before_install:
4545

4646
# Formatting checks:
4747
# Check for files starting with a blank line
48-
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'head -1 "$0" | grep --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at start of $0."; false; fi'
48+
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'head -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at start of $0."; false; fi'
4949
# Check for tabs
50-
- "if grep --line-number --recursive --exclude-dir=.git --regexp=$'\t' .; then echo 'Tab found.'; false; fi"
50+
- "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\t' .; then echo 'Tab found.'; false; fi"
5151
# Check for trailing whitespace
5252
- "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp='[[:blank:]]$' .; then echo 'Trailing whitespace found.'; false; fi"
5353
# Check for non-Unix line endings
5454
- "if grep --files-with-matches --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\r$' .; then echo 'Non-Unix EOL detected.'; false; fi"
5555
# Check for blank lines at end of files
56-
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'tail -1 "$0" | grep --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at end of $0."; false; fi'
56+
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'tail -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at end of $0."; false; fi'
5757
# Check for files that don't end in a newline (https://stackoverflow.com/a/25686825)
58-
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'if test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; false; fi'
58+
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'if test "$(grep --files-with-matches --binary-files=without-match --max-count=1 --regexp='.*' "$0")" && test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; false; fi'
5959

6060
- source "${TRAVIS_BUILD_DIR}/arduino-ci-script.sh"
6161

0 commit comments

Comments
 (0)