This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-28
Channels
- # aleph (4)
- # announcements (5)
- # babashka (28)
- # babashka-sci-dev (13)
- # beginners (63)
- # calva (76)
- # cider (113)
- # clara (7)
- # clj-kondo (42)
- # cljdoc (1)
- # clojure (170)
- # clojure-europe (20)
- # clojure-nl (17)
- # clojure-norway (3)
- # clojure-spec (12)
- # clojure-sweden (1)
- # clojure-uk (6)
- # clojurescript (55)
- # clojureverse-ops (1)
- # consulting (1)
- # core-async (9)
- # cursive (16)
- # data-science (1)
- # datascript (8)
- # datomic (27)
- # emacs (14)
- # events (1)
- # fulcro (10)
- # graphql (9)
- # gratitude (1)
- # jobs (6)
- # jobs-discuss (5)
- # leiningen (10)
- # lsp (35)
- # missionary (4)
- # nextjournal (9)
- # off-topic (46)
- # pathom (15)
- # pedestal (5)
- # polylith (37)
- # portal (15)
- # re-frame (22)
- # reagent (4)
- # reitit (5)
- # reveal (18)
- # shadow-cljs (20)
- # tools-deps (7)
- # xtdb (10)
Is there a way to do something like ... have an entry in a file that disables kondo in general for that file ?
Yeah, I was specifically looking for a way to be able to say in a file "this file is ok!" instead of having to mark that in a central location elsewhere.
the other option is {:clj-kondo/config {:linters {:unresolved-symbol {:level :off}}}
It actually found 3 errors in my production application that we hadn't run across yet.
@pmooser there is also #_:clj-kondo/ignore
that you can apply locally before a form, to ignore warnings
The only remaining challenge are a couple macros that the linter gets confused by, and one error that I cannot make sense of because the line number doesn't make sense with the given output. I'm probably doing something to confuse it.
(to be clear, there's no way for the linter to understand these macros, so that's obviously not a bug)
@borkdude The macro isn't similar enough to be able to say "treat it like this" ... It's a macro that has a couple of arguments that are essentially symbol names to bind things to, so when the linter runs it sees me passing (for example) _
as the name of such an argument and it complains that it is undefined.
(defmacro run-in-lane
[lane-id state-name & body]
`(run-function-in-lane ~lane-id
(fn [~state-name]
~@body)))
@pmooser you can let clj-kondo expand this macros using: https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md#macroexpand
I'm seeing an error reported as: Unresolved symbol: reagent
and that symbol does not occur on the corresponding reported line. Any tips on how I could debug this ?
Interestingly the symbol reagent
doesn't even occur in the file, except as part of various reagent symbols etc.
Maybe someday I can learn to set up kondo in such a way that I can just debug the linter myself, instead of wasting your time with it.
Well you can check out clj-kondo from git and then use it as a local/repo library and insert some printlns here and there ;)
But I would be happy to join you in a call to take a look, especially if you ended up sponsoring my open source eventually :)
I'd have to get permission from my corporate overlords to even take advantage of your generous offer, but I appreciate it!
Would be ok if I did some triage on the Github issues? Seems like there are things already solved, at least glancing at them.
@borkdude It would be nice to be able to distinguish between unused bindings in function arguments versus let blocks, since one of those means you are likely doing unnecessary work, whereas the other might just be a matter of style (I don't always rename all my unused incoming fn args as _ for example).
It depends. When writing a new function, it's often quite useful to see that you've forgotten to use an argument you expected to be necessary