Skip to content

Commit

Permalink
Add shellcheck target and CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
perlpunk committed Dec 5, 2021
1 parent 1ac5213 commit 2db89c0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ jobs:
- uses: actions/checkout@v2
- run: make test
# - uses: mxschmitt/action-tmate@v3

style:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- run: make style-check
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ test:
make gh-pages
make clean

style-check:
file --mime-type bin/* | grep text/x-shellscript | cut -d: -f1 | xargs shellcheck

add-new:
for f in new/*; do cp "$$f" "src/$${f#*-}"; done

Expand Down
1 change: 1 addition & 0 deletions bin/new-test-file
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ main() (
)

template() (
# shellcheck disable=SC1039
cat <<...
---
- name: <test title>
Expand Down
3 changes: 1 addition & 2 deletions bin/new-test-id
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
(
while true; do
id=$(
cat /dev/urandom |
LC_ALL=C tr -cd A-HJ-NP-Z2-9 |
LC_ALL=C tr -cd A-HJ-NP-Z2-9 < /dev/urandom |
fold -w4 |
grep '[A-Z]' |
grep '[0-9]' |
Expand Down
4 changes: 3 additions & 1 deletion bin/run-all-parsers
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
# It is used to run every test in the suite against each YAML parser.
#
#------------------------------------------------------------------------------
# shellcheck disable=SC2030
# shellcheck disable=SC2031

set -e -u -o pipefail

main() (
id=$ID
tmp=/tmp/test/$id

set -- $RUNNERS
set -- "$RUNNERS"

run-all-parsers "$@"

Expand Down
2 changes: 1 addition & 1 deletion bin/tsv-to-new
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ for line in "${each[@]}"; do
shift
done

if [[ $group && $group == $_group ]]; then
if [[ $group && $group == "$_group" ]]; then
more=1
else
more=''
Expand Down

0 comments on commit 2db89c0

Please sign in to comment.