]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Run shfmt in CI
authorTom Krizek <tkrizek@isc.org>
Tue, 24 Oct 2023 12:56:06 +0000 (14:56 +0200)
committerTom Krizek <tkrizek@isc.org>
Thu, 26 Oct 2023 11:06:53 +0000 (13:06 +0200)
Ensure our shell script format stays consistent in the future.

(cherry picked from commit b6505ff5734d0721d83369161e5c74a637982a5c)

.gitlab-ci.yml

index 46962daeeb4fe913e5b92e50bd3938cd1684e91d..182ee9a7fcaaf8f957dbc94584e05a4705e21d98 100644 (file)
@@ -612,6 +612,19 @@ reuse:
   script:
     - reuse lint
 
+shfmt:
+  <<: *precheck_job
+  needs: []
+  script:
+    - shfmt -w -i 2 -ci -bn . $(find . -name "*.sh.in")
+    - git diff > shfmt.patch
+    - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
+  artifacts:
+    paths:
+      - shfmt.patch
+    expire_in: "1 week"
+    when: on_failure
+
 danger:
   <<: *precheck_job
   needs: []