]> 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 08:23:52 +0000 (10:23 +0200)
Ensure our shell script format stays consistent in the future.

.gitlab-ci.yml

index e0f50a5d61d5b0446955c530228b9060d512e800..750841ba22760622cdfa16a35a43fca61ad773ab 100644 (file)
@@ -599,6 +599,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: []