This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-19
Channels
- # adventofcode (5)
- # announcements (1)
- # babashka (44)
- # beginners (83)
- # biff (10)
- # calva (1)
- # cherry (3)
- # cider (10)
- # clojure (78)
- # clojure-europe (12)
- # clojure-norway (1)
- # conjure (1)
- # cryogen (1)
- # datascript (4)
- # dev-tooling (2)
- # gratitude (2)
- # lsp (4)
- # malli (6)
- # off-topic (15)
- # polylith (9)
- # quil (19)
- # releases (1)
- # sci (6)
- # scittle (64)
- # sql (10)
- # squint (35)
Hey again 🙂 I'm dabbling around a bit more and noticed that clj-kondo does not seem to lint correctly without further instructions, e.g. a function that doesn't exist is not flagged by it. I tried a few different approaches, mostly along the lines of this:
clj-kondo --lint bases/http/resources:bases/http/src:bases/http/test:components/database/resources:components/database/src:components/database/test:components/logger/resources:components/logger/src:components/logger/test:development/src
But not seeing any errors despite referencing an undefined var. Do you have any additional guidance on making use of clj-kondo
in a polylith workspace?You are likely not passing things correctly, kondo will definitely complain about undefined stuff just fine
It has been a while at work since I looked at what we are doing, but I believe the polylith docs suggest having a dev alias that includes everything for running repls at dev time, and I believe that is also what we use for running kondo
Yeah, that's pretty much what I tried, use the classpath as defined by the :dev
alias and pass that to kondo.
i'm a kondo user here, the only change I had to make to my config.edn, was to add
:ignore [
:redefined-var
]
because components interface.clj
will redefine.Sort of tangential , but you can also use clojure-lsp to get kondo diagnostics and a bit more (its a superset, iirc).
/opt/homebrew/bin/clojure-lsp diagnostics
I don't think there's any special configuration required for this, but just in case here's my LSP config, .lsp/config.edn
{:source-aliases #{:dev :test :build :+repl}
:keep-parens-when-threading? true
:copy-kondo-configs? true
:semantic-tokens? false
:completion {:analysis-type :slow-but-accurate}
:java {:download-jdk-source? true}
:stubs {:generation {:namespaces #{"datomic.api"}}}}
Odd 🙂 I'll keep digging a bit more, and maybe I'll try your lsp config, wanted to give that a go for a while anways 🙂