Skip to content

Commit 1c83a1b

Browse files
authored
Added Shellcheck script and CI config. Closes sstephenson#14. (sstephenson#238)
Added Shellcheck script and CI config. Closes sstephenson#14.
2 parents 3adff32 + 07bbad5 commit 1c83a1b

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,19 @@ matrix:
2020
services:
2121
- docker
2222

23+
before_script:
24+
- |
25+
if [[ "${TRAVIS_OS_NAME:-}" == 'linux' ]]; then
26+
sudo apt-get install shellcheck
27+
fi
28+
2329
script:
2430
- |
31+
if [[ "${TRAVIS_OS_NAME:-}" == 'linux' ]]; then
32+
# @todo: Remove "|| true" once all coding standards issues are fixed.
33+
./shellcheck.sh || true
34+
fi
35+
2536
if [[ "${TRAVIS_OS_NAME:-}" == 'linux' && -n "${BASHVER}" ]]; then
2637
docker build --build-arg bashver="${BASHVER}" --tag "bats/bats:bash-${BASHVER}" . &&
2738
docker run -it "bash:${BASHVER}" --version &&

shellcheck.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
targets=()
6+
while IFS= read -r -d $'\0'; do
7+
targets+=("$REPLY")
8+
done < <(
9+
find \
10+
bin/bats \
11+
libexec/bats-core \
12+
shellcheck.sh \
13+
-type f \
14+
-print0
15+
)
16+
17+
for file in "${targets[@]}"; do
18+
[ -f "${file}" ] && LC_ALL=C.UTF-8 shellcheck "${file}"
19+
done;

0 commit comments

Comments
 (0)