This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-12
Channels
- # announcements (2)
- # babashka (26)
- # beginners (48)
- # calva (32)
- # cider (23)
- # clj-kondo (61)
- # cljfx (3)
- # clojure (93)
- # clojure-australia (2)
- # clojure-europe (23)
- # clojure-losangeles (1)
- # clojure-nl (5)
- # clojure-uk (4)
- # clojurescript (46)
- # cloverage (9)
- # code-reviews (1)
- # copenhagen-clojurians (1)
- # cursive (39)
- # data-science (6)
- # datahike (8)
- # deps-new (8)
- # depstar (2)
- # etaoin (1)
- # fulcro (2)
- # funcool (2)
- # graalvm (5)
- # jackdaw (3)
- # java (17)
- # jobs-discuss (43)
- # kaocha (2)
- # leiningen (25)
- # malli (8)
- # minecraft (1)
- # missionary (8)
- # observability (6)
- # off-topic (37)
- # other-languages (12)
- # practicalli (1)
- # reagent (4)
- # releases (78)
- # remote-jobs (1)
- # sci (9)
- # shadow-cljs (13)
- # spacemacs (6)
- # sql (1)
- # tools-deps (30)
- # xtdb (3)
The latest clojure-extras plugin for IntelliJ which integrates clj-kondo, has a lot better performance! https://plugins.jetbrains.com/plugin/18108-clojure-extras/ Thank you @brcosta!
@brcosta Perhaps you can also rename the github repo to clojure-extras and also link to the marketplace from there.

I think the locations of the yellow stuff can be fixed by the plugin, perhaps. I did a similar thing in clj-kondo.lsp for Calva. https://github.com/clj-kondo/clj-kondo.lsp/blob/53b59828bfc6a6dab8c67ca4e1442093fec4b5c8/server/src/clj_kondo/lsp_server/impl/server.clj#L76-L88
in the library semantic-csv, there are a bunch of casting functions (`->int` converts a value to an int if possible), which are defined using an in-house function called clone-var
. The block of code that defines them is wrapped in a reader conditional and I’m not sure exactly how to make these functions lint as functions:
https://github.com/metasoarous/semantic-csv/blob/10f436bacf2ca9ed2f22ffbbecea6467ba20c2e4/src/semantic_csv/core.cljc#L321-L335
any ideas how to make clj-kondo recognize or at least stop marking them as “unresolved var”?
@nbtheduke :lint-as {foo.bar.impl/clone-var clojure.core/declare}
you can add this namespace to {:linters {:unresolved-var {:exclude [semantic-csv.core]}}}
or make a proper macro for it in .clj-kondo
The macro would look something like:
(defmacro clone-var [sym] (def ~(symbol (name sym)) ~sym)))
cool, i’ll give that a whirl! thank you for the help
I have the same problem as https://github.com/clj-kondo/clj-kondo/issues/272, which is closed. any advice? Repro:
git clone
cd tools.deps.alpha
clj -M:lint
src/main/clojure/clojure/tools/deps/alpha/specs.clj:122:9: error: Unresolved symbol: clojure.tools.deps.alpha/resolve-deps
src/main/clojure/clojure/tools/deps/alpha/specs.clj:126:9: error: Unresolved symbol: clojure.tools.deps.alpha/make-classpath-map
src/main/clojure/clojure/tools/deps/alpha/specs.clj:130:9: error: Unresolved symbol: clojure.tools.deps.alpha/make-classpath
The error goes away when I add [clojure.tools.deps.alpha]
to the namespace form. I think clj-kondo expects the fdef name to be related to one of your loaded namespaces.
(ns clojure.tools.deps.alpha.specs
(:require [clojure.spec.alpha :as s]
[clojure.tools.deps.alpha]))
but that's not necessary
it's just a symbol going in the registry
This is the config which makes those things go away for now:
{:skip-args [clojure.core/comment]
:linters
{:unused-binding {:level :off}
:unresolved-symbol [(clojure.spec.alpha/fdef)]}}
when I added that :unresolved-symbol
line above, I suddenly got 100s of warnings/errors
seemed weird that was a vector and not a key in a map?
Ah sorry, my bad.
{:skip-comments true
:linters
{:unused-binding {:level :off}
:unresolved-symbol {:exclude [(clojure.spec.alpha/fdef)]}}}
the (..)
means, within a call to. without the parens it means: ignore this symbol itself globally. I kind of regret this but I stole this 2.5 years ago based on what joker was doing at the time. sorry about that ;)
you can also say:
:exclude [(foo.bar/baz [x y z])]
which ignores only the symbols x y z
within calls to foo.bar/baz
I checked the implementation of the fdef
analysis and it was explicitly written as: if the namespace is unresolved, then the symbol is reported as unresolved. Since you can easily make typos and most people will load the namespace when they write specs.
I tried that config and it didn't suppress the errors
your last code block above
this one?
{:skip-comments true
:linters
{:unused-binding {:level :off}
:unresolved-symbol {:exclude [(clojure.spec.alpha/fdef)]}}}
% cat .clj-kondo/config.edn
{:skip-comments true
:linters
{:unused-binding {:level :off}
:unresolved-symbol {:exclude [(clojure.spec.alpha/fdef)]}}}
% clj -M:lint
src/main/clojure/clojure/tools/deps/alpha/specs.clj:122:9: error: Unresolved symbol: clojure.tools.deps.alpha/resolve-deps
src/main/clojure/clojure/tools/deps/alpha/specs.clj:126:9: error: Unresolved symbol: clojure.tools.deps.alpha/make-classpath-map
src/main/clojure/clojure/tools/deps/alpha/specs.clj:130:9: error: Unresolved symbol: clojure.tools.deps.alpha/make-classpath
linting took 1088ms, errors: 3, warnings: 0
ah my bad again, I get the same. argh, yeah, it uses a "custom" way to handle that so configuring won't work.
#_:clj-kondo/ignore ;; see kondo issue #1532
(s/fdef clojure.tools.deps.alpha/resolve-deps
:args (s/cat :deps ::deps-map :options ::resolve-args)
:ret ::lib-map)
Fixed in newest kondo and 0.4.5 of the plugin: https://plugins.jetbrains.com/plugin/18108-clojure-extras/
I tried adding a suppression in the config per that issue, but it did not suppress
Seeing some strange behaviour using Cursive + clojure extras + clj-kondo. A number of vars are reported as unresolved, while they are clearly not. Only inside cursive, not in clj-kondo CLI
@brcosta Are you sending the :filename ...
so clj-kondo can see that this is .cljs code?
could you make an issue at https://github.com/brcosta/clj-stuff-plugin so we don't forget?