diff options
author | Christian Segundo | 2024-04-06 22:32:02 +0200 |
---|---|---|
committer | Christian Segundo | 2024-04-07 03:35:46 +0200 |
commit | d4b6f246e6a16110650a57185b3d9b5acb579cf1 (patch) | |
tree | 98cf60468de04f1b70429a229072270dca6c6a98 /.scripts.d/10-check.sh | |
parent | 6e7734ff026b5be928703a4ad31ba4abaaf1535b (diff) | |
download | languagetool-d4b6f246e6a16110650a57185b3d9b5acb579cf1.tar.gz |
move ci
Diffstat (limited to '.scripts.d/10-check.sh')
-rw-r--r-- | .scripts.d/10-check.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/.scripts.d/10-check.sh b/.scripts.d/10-check.sh new file mode 100644 index 0000000..e8ddf59 --- /dev/null +++ b/.scripts.d/10-check.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# vim: ai:ts=8:sw=8:noet +set -EeufCo pipefail +export SHELLOPTS # propagate set to children by default +IFS=$'\t\n' + +# check required commands are in place +command -v shellcheck >/dev/null 2>&1 || { + echo 'please install shellcheck' + exit 1 +} +command -v hadolint >/dev/null 2>&1 || { + echo 'please install hadolint' + exit 1 +} +command -v yamllint >/dev/null 2>&1 || { + echo 'please install yamllint' + exit 1 +} + +# check all the Dockerfiles with hadolint +find . \ + -type f \ + -name 'Dockerfile' \ + -print0 | + xargs -0 -r hadolint + +# check all the yaml files with yamllint +find . -type f \ + -regex '.*\.ya?ml\(lint\)?' \ + -print0 | + xargs -0 -r yamllint -s + +# check all sh files with shellcheck +find . \ + -type f \ + -name '*.sh' \ + -print0 | + xargs -0 -r shellcheck |