]> ruderich.org/simon Gitweb - safcm/safcm.git/commitdiff
Makefile: add lint target to run shellcheck
authorSimon Ruderich <simon@ruderich.org>
Wed, 12 May 2021 05:40:56 +0000 (07:40 +0200)
committerSimon Ruderich <simon@ruderich.org>
Wed, 12 May 2021 05:40:56 +0000 (07:40 +0200)
.builds/archlinux.yml
.builds/freebsd.yml
.builds/openbsd.yml
.gitlab-ci.yml
Makefile
ci/run

index 4adc85f0307e230c5af696e6261acea51eb92664..0c4671c374eb9b2f7125281ab46824c1398b607a 100644 (file)
@@ -1,6 +1,7 @@
 image: archlinux
 packages:
   - go
+  - shellcheck
 tasks:
   - all: |
       cd safcm
index e3ea472768e717889699f35210d829932188a924..6ede0f83a4b054671a14e337016b7f279f35f2a5 100644 (file)
@@ -2,6 +2,7 @@ image: freebsd/latest
 packages:
   - go
   - gmake
+  - hs-shellcheck
 tasks:
   - all: |
       sudo ln -sf /usr/local/bin/gmake /usr/bin/make
index 025d49a1b5412d6ba94708664e288ef5b7da1f90..a0d29d9f10e2ee84a6bd9a445980a827a8ddce9d 100644 (file)
@@ -3,6 +3,7 @@ packages:
   - go
   - gmake
   - xz
+  - shellcheck
 tasks:
   - all: |
       # OpenBSD 6.8 only ships with Go 1.15
index e2ec0a52a7582a9265fd431dbf90b2d41bebaabc..0bacecd89c17500918bfac60609bd76369cc9402 100644 (file)
@@ -1,7 +1,7 @@
 .template-docker: &template-docker
   before_script:
     - apt-get update
-    - apt-get install --no-install-recommends --yes build-essential ca-certificates git golang golang-1.16 golang-golang-x-tools make openssh-server
+    - apt-get install --no-install-recommends --yes build-essential ca-certificates git golang golang-1.16 golang-golang-x-tools make openssh-server shellcheck
   script:
     # Gitlab-runner uses umask 0000 (wtf?!) and mixes nobody and root user
     # when setting up the environment. This breaks ssh's permission check on
index 95cc9c86278b87d59d4b36ababfd3b685acb2753..fa2db0bbd326f4a4f3da2dfc9e3ef8b531460a41 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,11 @@ test:
        go vet ./...
        go test $(GOFLAGS) ./...
 
+lint:
+       shellcheck ci/run
+       shellcheck cmd/safcm-remote/build.sh
+       shellcheck cmd/safcm/testdata/ssh/prepare.sh
+
 clean:
        rm -rf remote/helpers/
        rm -f safcm
diff --git a/ci/run b/ci/run
index 1b240a600b2b33f0d7b45924be6d6859320c13ae..67c0e47c74713e8bc775761dd341137e1e3046c7 100755 (executable)
--- a/ci/run
+++ b/ci/run
@@ -20,6 +20,7 @@ export SAFCM_CI_RUN
 make $flags
 # shellcheck disable=SC2086
 make test $flags
+make lint
 
 # Strict umask
 umask 077