forked from mathertel/DmxSerial2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis-ci.sh
29 lines (25 loc) · 999 Bytes
/
.travis-ci.sh
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
#!/bin/bash
# This script is triggered from the script section of .travis.yml
# It runs the appropriate commands depending on the task requested.
set -e
SPELLINGBLACKLIST=$(cat <<-BLACKLIST
-wholename "./.codespellignore" -or \
-wholename "./.git/*"
BLACKLIST
)
if [[ $TASK = 'codespell' ]]; then
# run codespell only if it is the requested task
# count the number of codespell errors
spellingerrors=$(zrun codespell --check-filenames --check-hidden --quiet 2 --regex "[a-zA-Z0-9][\\-'a-zA-Z0-9]+[a-zA-Z0-9]" $spellingfiles 2>&1 | wc -l)
if [[ $spellingerrors -ne 0 ]]; then
# print the output for info
zrun codespell --check-filenames --check-hidden --quiet 2 --regex "[a-zA-Z0-9][\\-'a-zA-Z0-9]+[a-zA-Z0-9]" $spellingfiles
echo "Found $spellingerrors spelling errors via codespell"
exit 1;
else
echo "Found $spellingerrors spelling errors via codespell"
fi;
else
# Otherwise compile and check as normal
platformio ci --lib="." --board=$BOARD
fi