Fix CI lint step to properly handle clj-kondo exit code 1 #5
+21
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The CI pipeline was failing when
lein lint(clj-kondo) exited with code 1, even though the previous fix attempted to handle warnings by checking for exit code 2. The issue was with the command structure:This approach has a critical flaw: when
lein lintfails with exit code 1, thetest $? -eq 2command executes, but by then$?contains the exit code fromlein lint(which is 1), sotest 1 -eq 2fails, causing the entire step to fail.Solution
Replaced the fragile one-liner with a robust multi-step script that:
EXIT_CODE=$?preserves the linter's actual exit codeChanges
This ensures the CI pipeline behaves correctly regardless of whether clj-kondo returns warnings (code 2) or actual linting errors (code 1), while maintaining the desired behavior of allowing builds to pass when only warnings are present.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
my.datomic.comjava -Dfile.encoding=UTF-8 -Dmaven.wagon.http.ssl.easy=false -Dmaven.wagon.rto=10000 -Xbootclasspath/a:/home/REDACTED/.lein/self-installs/leiningen-2.11.2-standalone.jar -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Dleiningen.input-checksum= -Dleiningen.original.pwd=/home/REDACTED/work/orcpub/orcpub -Dleiningen.script=/usr/local/bin/lein -classpath /home/REDACTED/.lein/self-installs/leiningen-2.11.2-standalone.jar clojure.main -m leiningen.core.main -v(dns block)repo.clojars.orgjava -Dfile.encoding=UTF-8 -Dmaven.wagon.http.ssl.easy=false -Dmaven.wagon.rto=10000 -Xbootclasspath/a:/home/REDACTED/.lein/self-installs/leiningen-2.11.2-standalone.jar -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Dleiningen.input-checksum= -Dleiningen.original.pwd=/home/REDACTED/work/orcpub/orcpub -Dleiningen.script=/usr/local/bin/lein -classpath /home/REDACTED/.lein/self-installs/leiningen-2.11.2-standalone.jar clojure.main -m leiningen.core.main -v(dns block)repository.apache.orgjava -Dfile.encoding=UTF-8 -Dmaven.wagon.http.ssl.easy=false -Dmaven.wagon.rto=10000 -Xbootclasspath/a:/home/REDACTED/.lein/self-installs/leiningen-2.11.2-standalone.jar -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Dleiningen.input-checksum= -Dleiningen.original.pwd=/home/REDACTED/work/orcpub/orcpub -Dleiningen.script=/usr/local/bin/lein -classpath /home/REDACTED/.lein/self-installs/leiningen-2.11.2-standalone.jar clojure.main -m leiningen.core.main -v(dns block)If you need me to access, download, or install something from one of these locations, you can either:
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.