-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.travis.yml
More file actions
48 lines (41 loc) · 2.4 KB
/
.travis.yml
File metadata and controls
48 lines (41 loc) · 2.4 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This file is used to configure the Travis CI tests for this repository
matrix:
include:
# Check all the files in the repository for consistent formatting
- name: 'File Formatting Checks'
language: minimal
script:
# Check for UTF-8 BOM file encoding
- find . -path './.git' -prune -or -type f -exec grep --files-with-matches --binary-files=without-match $'\xEF\xBB\xBF' '{}' \; -exec echo 'UTF-8 BOM encoding detected.' \; -exec false '{}' +
# 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 --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 --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 "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; false; fi'
# Check all files in the repository for commonly misspelled words
- name: 'Spell Check'
language: python
python: 3.6
install:
# Install codespell
# https://github.com/codespell-project/codespell
- pip install codespell
script:
- codespell --skip="${TRAVIS_BUILD_DIR}/.git" "${TRAVIS_BUILD_DIR}"
notifications:
email:
on_success: always
on_failure: always
webhooks:
urls:
# Use TravisBuddy to automatically comment on any pull request that results in a failing CI build
- https://www.travisbuddy.com/
on_success: never
on_failure: always