This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-10
Channels
- # announcements (48)
- # asami (8)
- # babashka (186)
- # beginners (56)
- # calva (42)
- # clerk (84)
- # clj-kondo (75)
- # cljdoc (21)
- # clojure (121)
- # clojure-art (1)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-conj (2)
- # clojure-europe (10)
- # clojure-filipino (1)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (2)
- # clojure-norway (9)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojure-uk (2)
- # clojurescript (11)
- # cursive (30)
- # datalevin (20)
- # datomic (4)
- # fulcro (5)
- # gratitude (1)
- # hyperfiddle (89)
- # introduce-yourself (1)
- # java (5)
- # jobs-discuss (8)
- # lsp (89)
- # malli (57)
- # membrane (16)
- # off-topic (12)
- # pathom (38)
- # releases (5)
- # shadow-cljs (17)
- # tools-deps (18)
- # xtdb (62)
question on kondo invoked from a bb.edn task… I noticed that my warnings are not causing CI failure https://github.com/mentat-collective/emmy/actions/runs/4379015980/jobs/7664467312
here is my bb.edn
:
{:pods {clj-kondo/clj-kondo {:version "2023.01.20"}}
:tasks
{:requires ([pod.borkdude.clj-kondo :as clj-kondo])
lint
{:doc "Lint with clj-kondo."
:task (clj-kondo/print!
(clj-kondo/run! {:lint ["src" "test"]}))}}}
This is because you're running clj-kondo manually, you should manually handle errors and failures
but it's now recommended to use this instead of the pod directly: https://github.com/clj-kondo/clj-kondo-bb/blob/246ac4c09ac32008025d7e8da28211e448b9fc91/src/clj_kondo/core.bb#L13
nice, like
lint
{:doc "Lint with clj-kondo."
:task (clj-kondo/exec {:lint ["src" "test"]})}
?[sritchie@wintermute ~/code/clj/emmy (sritchie/docstrings)]$ bb lint
----- Error --------------------------------------------------------------------
Type: java.lang.NullPointerException
Location: <expr>:20:1
----- Context ------------------------------------------------------------------
16: (when-not (resolve 'run)
17: (intern *ns* 'run babashka.tasks/run))
18:
19: (when-not (resolve 'exec)
20: (intern *ns* 'exec @(var babashka.tasks/exec)))
^---
21:
22: nil
23: (def lint (binding [
24: babashka.tasks/*task* '{:name lint, :doc "Lint with clj-kondo.", :task (exec 'clj-kondo.core/exec), :exec-args {:lint ["src" "test"]}}]
25: nil
----- Stack trace --------------------------------------------------------------
exec-af4cd7c4-a77a-487a-a098-1c4e132ebcc0/exec - <expr>:20:1
exec-af4cd7c4-a77a-487a-a098-1c4e132ebcc0 - <expr>:4:1
user-49a145ee-67a2-44ef-868b-b6368ff89c06 - <expr>:26:1
This is with
{:pods {clj-kondo/clj-kondo {:version "2023.01.20"}}
:tasks
{:requires ([pod.borkdude.clj-kondo :as clj-kondo])
lint
{:doc "Lint with clj-kondo."
:task (exec 'clj-kondo.core/exec)
:exec-args {:lint ["src" "test"]}}}}
the dependency being: https://github.com/clj-kondo/clj-kondo-bb
that worked, thank you! time to upgrade all my projects…
I like the suffix version personally, mirroring the file extension
I think you inspired me to do that for mathbox.cljs etc, and then I saw you moved back to dashes!
I first actually had http://clj-kondo.bb but then all kinds of apps made that into a hyperlink to a non-existing website
haha yes that was it
how did you get GitHub to syntax-highlight bb files as Clojure? or is it doing inference on the file contents?
https://github.com/mentat-collective/emmy/actions/runs/4388062311/jobs/7684113615
this is a bit strange, @borkdude… digging in now, but on CI, after this change,
Downloading: org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar from central
----- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message: Could not resolve symbol: exec
Phase: analysis
Error: Process completed with exit code 1.
let me upgrade babaska there and see what happens
haha hadn’t done any gardening in the actions for a while
btw I use setup-clojure for almost everything in github actions now and just say: bb: latest
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install babashka
uses: just-sultanov/setup-babashka@v2
with:
version: '1.2.174'
- name: Cache kondo directory
uses: actions/cache@v2
with:
path: ~/.clj-kondo/.cache
key: ${{ runner.os }}-kondo
restore-keys: ${{ runner.os }}-kondo
- name: Run clj-kondo
run: bb lint --config '{:output {:pattern "::{{level}} file={{filename}},line={{row}},col={{col}}::{{message}}"}}'
time for me to upgrade this too!I bet latest would work here as well
Is this to please github with inline annotations?
"::{{level}} file={{filename}},line={{row}},col={{col}}::{{message}}"}
woah, look at this antique
@borkdude yeah that’s right
with the CLI tool, the default level fails on warn…
--fail-level <level>: minimum severity for exit with error code. Supported values:
warning, error. The default level if unspecified is warning.
what change should I make to have the task set a nonzero exit code?I tried bringing in an old library I wrote a while back that had some clj-kondo exports configured. https://github.com/johnmn3/dispacio/blob/master/.clj-kondo/test.clj @borkdude you helped me out with it in the past and added that test file. In my new project, I'm seeing this error:
that test file in there, I believe that's what is causing a downstream consuming project to cause that read-string
error above
the test.clj
file isn't exposed to other libraries since it's not on your exported files
well all of my defp
statements like that, they are correctly interpreting the defmethod syntax inside it, but the outer bracket has that red underscoe
can you make a screenshot of the surroundings? the first screenshot was very local and not informative
And so as you can see in that file, I've updated the file to include a require statement for clojure.edn
And so I updated the dep in my project to the latest git hash for that repo, but I'm still seeing the error. Does clj-kondo only auto-checkout exports from clojar releases?
I ran into this earlier this week and I am wondering if building a clj-kondo checker would be possible? A check for invalid number of arguments to the function passed to update
/`swap!` style functions.
(defn two-args
[coll x]
(conj coll x))
(update {:a [1]} :a two-args) ;; uh-oh, wrong number of args to two-args but not flagged
(two-args []) ;; flagged as invalid-arity