This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-13
Channels
- # announcements (12)
- # babashka (42)
- # beginners (45)
- # calva (60)
- # cider (6)
- # circleci (1)
- # clj-kondo (18)
- # clojure (21)
- # clojurescript (36)
- # conjure (13)
- # cursive (2)
- # datahike (5)
- # datomic (4)
- # depstar (17)
- # emacs (4)
- # fulcro (3)
- # honeysql (2)
- # jobs (2)
- # jobs-discuss (9)
- # lsp (98)
- # malli (32)
- # off-topic (36)
- # other-languages (2)
- # overtone (4)
- # re-frame (5)
- # reveal (7)
- # rewrite-clj (47)
- # shadow-cljs (25)
- # spacemacs (4)
- # vim (7)
Wondering if anyone could give me an example of namespace local config for clj-kondo. I've tried:
(ns
^{:clj-kondo/config '{:linters {:unresolved-symbol {:level :off}}}}
(:require ...))
But I haven't been able to get it to work, and I've not been able to find an example of the syntax in the docs.
@ezmiller77 That's almost correct, you have to remove the ^
And the ns form has special syntax for this: if you put the map after the name it will also work
🎇 That did it!
Thank you. I think this is my first time adding metadata to the ns form.
And thank you for the VERY fast response!
Is there a way to avoid an error exit code for warnings?
Or is this not encouraged?
@ezmiller77 This is the contract with regards to exit codes: https://github.com/clj-kondo/clj-kondo#exit-codes
Hmmm. I'm using clj-kondo in the context of github actions, which seem to fail on any exit code other than 0. I'm looking around to see if this is something I can configure....
GH actions by default failed if exit code is not zero. You can wrap call to clj-kondo in a script which will catch exit code, analyze it and transform it to zero in case there's only warnings.
echo '(def x (def x 1))' | clj-kondo --lint - || if [[ $? = 2 ]]; then exit 0; else exit $?; fi
this snippet pipes output of clj-kondo to simple if/else expression which is transforming exit code 2 (more than one warning found but no errors) to exit 0 indicating that this should be OK result in the scope of GH actions.Maybe @delaguardo knows the answer here.
Another question related to the unresolved-var
linter. I'm getting some warnings about unresolved vars in a namespace. I thought the problem was that the namespace used :as
instead of :refer
but I switched it to refer an am still getting the warning. Any idea what might be happening?