|
1 | 1 | # This file is used to configure the Travis CI tests for this repository |
2 | 2 |
|
3 | | -sudo: false |
4 | | - |
5 | | - |
6 | | -# It's necessary to do this just for codespell |
7 | | -language: python |
8 | | -python: 3.6 |
9 | | - |
10 | | - |
11 | | -script: |
12 | | - # Formatting checks: |
13 | | - # Check for files starting with a blank line |
14 | | - - 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' |
15 | | - # Check for tabs |
16 | | - - "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\t' .; then echo 'Tab found.'; false; fi" |
17 | | - # Check for trailing whitespace |
18 | | - - "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp='[[:blank:]]$' .; then echo 'Trailing whitespace found.'; false; fi" |
19 | | - # Check for non-Unix line endings |
20 | | - - "if grep --files-with-matches --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\r$' .; then echo 'Non-Unix EOL detected.'; false; fi" |
21 | | - # Check for blank lines at end of files |
22 | | - - 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' |
23 | | - # Check for files that don't end in a newline (https://stackoverflow.com/a/25686825) |
24 | | - - 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' |
25 | | - |
26 | | - # Check for typos |
27 | | - - pip install codespell |
28 | | - - codespell --skip="${TRAVIS_BUILD_DIR}/.git" "${TRAVIS_BUILD_DIR}" |
| 3 | +env: |
| 4 | +matrix: |
| 5 | + include: |
| 6 | + - name: "Formatting checks" |
| 7 | + language: minimal |
| 8 | + script: |
| 9 | + # Formatting checks: |
| 10 | + # Check for files starting with a blank line |
| 11 | + - 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' |
| 12 | + # Check for tabs |
| 13 | + - "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\t' .; then echo 'Tab found.'; false; fi" |
| 14 | + # Check for trailing whitespace |
| 15 | + - "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp='[[:blank:]]$' .; then echo 'Trailing whitespace found.'; false; fi" |
| 16 | + # Check for non-Unix line endings |
| 17 | + - "if grep --files-with-matches --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\r$' .; then echo 'Non-Unix EOL detected.'; false; fi" |
| 18 | + # Check for blank lines at end of files |
| 19 | + - 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' |
| 20 | + # Check for files that don't end in a newline (https://stackoverflow.com/a/25686825) |
| 21 | + - 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' |
| 22 | + |
| 23 | + - name: "Spell check" |
| 24 | + language: python |
| 25 | + python: 3.6 |
| 26 | + install: |
| 27 | + # https://github.com/codespell-project/codespell |
| 28 | + - pip install codespell |
| 29 | + script: |
| 30 | + - codespell --skip="${TRAVIS_BUILD_DIR}/.git" "${TRAVIS_BUILD_DIR}" |
29 | 31 |
|
30 | 32 |
|
31 | 33 | notifications: |
|
0 commit comments