forked from per1234/batch-smart-resize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
26 lines (21 loc) · 1.59 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This file is used to configure the Travis CI tests for this repository
sudo: false
language: bash
script:
# Formatting checks:
# Check for files starting with a blank line
- 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'
# Check for tabs
- "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\t' .; then echo 'Tab found.'; false; fi"
# Check for trailing whitespace
- "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp='[[:blank:]]$' .; then echo 'Trailing whitespace found.'; false; fi"
# Check for non-Unix line endings
- "if grep --files-with-matches --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\r$' .; then echo 'Non-Unix EOL detected.'; false; fi"
# Check for blank lines at end of files
- 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'
# Check for files that don't end in a newline (https://stackoverflow.com/a/25686825)
- 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'
notifications:
email:
on_success: always
on_failure: always