From cfcfe1ae5336ffe12fd06bc67b70b34bb674687d Mon Sep 17 00:00:00 2001 From: Kyle Cesare Date: Sat, 10 Oct 2026 14:47:38 -0600 Subject: [PATCH 1/3] Add linting for jank-build.bb files Exit task with linter exit code --- .clj-kondo/config.edn | 2 ++ .github/actions/test/action.yml | 8 ++++++++ bb.edn | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100644 .clj-kondo/config.edn create mode 100644 bb.edn diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn new file mode 100644 index 0000000..4565882 --- /dev/null +++ b/.clj-kondo/config.edn @@ -0,0 +1,2 @@ +{:linters {:duplicate-require {:level off} + :unresolved-symbol {:exclude [*input*]}}} diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 9b7baa9..a59424a 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -11,6 +11,11 @@ runs: sudo ./install-bb which bb + curl -sLO https://raw.githubusercontent.com/clj-kondo/clj-kondo/master/script/install-clj-kondo + chmod +x install-clj-kondo + ./install-clj-kondo + which clj-kondo + failed_packages=() for project in */project.clj; @@ -18,6 +23,9 @@ runs: package="${project%/project.clj}" pushd "${package}" + if [[ -f "jank-build.bb" ]]; then + clj-kondo --lint jank-build.bb || failed_packages+=("${package}") + fi lein install || failed_packages+=("${package}") popd done diff --git a/bb.edn b/bb.edn new file mode 100644 index 0000000..cb62c08 --- /dev/null +++ b/bb.edn @@ -0,0 +1,9 @@ +{:tasks + {:requires [[babashka.fs :as fs] + [babashka.process :refer [shell]]] + lint (let [files (fs/glob "." "*/jank-build.bb")] + (when (seq files) + (-> + (apply shell {:continue true} "clj-kondo" "--lint" files) + :exit + System/exit)))}} From 2f85fa20d3918e2c759d9d556815e598be4c6ba7 Mon Sep 17 00:00:00 2001 From: Kyle Cesare Date: Mon, 12 Oct 2026 19:05:27 -0600 Subject: [PATCH 2/3] Make linting its own action --- .github/actions/test/action.yml | 8 -------- .github/workflows/test-and-publish.yml | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index a59424a..9b7baa9 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -11,11 +11,6 @@ runs: sudo ./install-bb which bb - curl -sLO https://raw.githubusercontent.com/clj-kondo/clj-kondo/master/script/install-clj-kondo - chmod +x install-clj-kondo - ./install-clj-kondo - which clj-kondo - failed_packages=() for project in */project.clj; @@ -23,9 +18,6 @@ runs: package="${project%/project.clj}" pushd "${package}" - if [[ -f "jank-build.bb" ]]; then - clj-kondo --lint jank-build.bb || failed_packages+=("${package}") - fi lein install || failed_packages+=("${package}") popd done diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml index fcf64dd..5edf1f1 100644 --- a/.github/workflows/test-and-publish.yml +++ b/.github/workflows/test-and-publish.yml @@ -16,6 +16,27 @@ concurrency: cancel-in-progress: true jobs: + lint: + name: Lint + runs-on: ubuntu-24.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a + with: + submodules: true + - name: Install bb & clj-kondo + run: | + curl -sL -o install-bb https://raw.githubusercontent.com/babashka/babashka/master/install + chmod +x install-bb + sudo ./install-bb + + curl -sLO https://raw.githubusercontent.com/clj-kondo/clj-kondo/master/script/install-clj-kondo + chmod +x install-clj-kondo + ./install-clj-kondo + which clj-kondo + - name: Lint + run: bb lint + ubuntu-test: name: Ubuntu 24.04 - Test runs-on: ubuntu-24.04 From ae668bb1f66b59ad5fa04bc92b573246bf432896 Mon Sep 17 00:00:00 2001 From: Kyle Cesare Date: Mon, 12 Oct 2026 19:08:07 -0600 Subject: [PATCH 3/3] Don't need submodules for linting --- .github/workflows/test-and-publish.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml index 5edf1f1..ebb148c 100644 --- a/.github/workflows/test-and-publish.yml +++ b/.github/workflows/test-and-publish.yml @@ -19,11 +19,10 @@ jobs: lint: name: Lint runs-on: ubuntu-24.04 - timeout-minutes: 30 steps: - uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a with: - submodules: true + submodules: false - name: Install bb & clj-kondo run: | curl -sL -o install-bb https://raw.githubusercontent.com/babashka/babashka/master/install