This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-30
Channels
- # babashka (46)
- # beginners (234)
- # bristol-clojurians (4)
- # cider (7)
- # clj-kondo (39)
- # cljdoc (8)
- # cljs-dev (10)
- # cljsjs (10)
- # cljsrn (24)
- # clojure (84)
- # clojure-brasil (7)
- # clojure-europe (12)
- # clojure-germany (4)
- # clojure-italy (3)
- # clojure-nl (41)
- # clojure-spec (17)
- # clojure-uk (66)
- # clojurescript (64)
- # conjure (161)
- # cursive (12)
- # data-science (45)
- # datomic (20)
- # devops (11)
- # docker (2)
- # duct (9)
- # events (7)
- # figwheel (1)
- # figwheel-main (20)
- # fulcro (32)
- # graalvm (5)
- # helix (82)
- # jackdaw (9)
- # jobs-discuss (19)
- # kaocha (11)
- # local-first-clojure (1)
- # malli (6)
- # meander (3)
- # nrepl (12)
- # off-topic (2)
- # other-lisps (15)
- # pathom (14)
- # rdf (6)
- # re-frame (8)
- # reactive (1)
- # reagent (5)
- # reitit (4)
- # rum (3)
- # shadow-cljs (77)
- # spacemacs (3)
- # sql (9)
- # test-check (31)
- # tools-deps (13)
- # vim (62)
- # xtdb (18)
Hi @borkdude
Looks like I cannot disable :unresolved-namespace
linter using namespace meta.
(ns dev.playground
{:clj-kondo/config {:linters {:unresolved-namespace {:level :off}}}})
(clojure.java.shell/sh "whoami")
> warning: Unresolved namespace clojure.java.shell. Are you missing a require?
But the option works when placed in the main config.@serioga I also noticed that myself and created an issue for it: https://github.com/borkdude/clj-kondo/issues/870
I have a single file for experiments in my project. So I don't want to see warnings when I check whole project.
@serioga You can also ignore that file with clj-kondo --lint "$(clj -Spath)" --config '{:output {:include-files ["^clojure/test"] :exclude-files ["tap"]}}'
Also I think it would be useful to be able to specify exact namespaces to ignore. Especially those which are preloaded using profiles.clj.
> You can also ignore that file not sure I want to ignore it completely when editing 🙂
> it would be useful to be able to specify exact namespaces to ignore what do you think about this?
especially this is annoying inside comment
, where Cursive and clj-kondo cannot agree about used/unused namespace aliaces
> turn linting off in comment also bad option, this helps to keep commented code in sync
yes, I prefer to keep it on as well, but personally I don't have any conflicts with unresolved namespaces in comment sections
Also maybe it would be useful to print linter ID with message. It's tricky to find exact configuration option from the message.
@serioga you can also output as JSON or EDN, this will also print the name of the linter
I know about config.md
.
But having message "Unresolved namespace" I cannot find this text there.
@borkdude
> It is documented at the top of config.md how to find those names.
Can you point me to exact text?
The use-case: I see a message warning: Unresolved namespace clojure.java.shell. Are you missing a require?
. How can I find corresponding linter ID from config.md
or linked configuration file?
@serioga "Look at the default configuration for all available options." There is a link in that sentence
Yes, it is liked to https://github.com/borkdude/clj-kondo/blob/master/src/clj_kondo/impl/config.clj
But where is no text Unresolved namespace
there!
My point is that I should guess linter ID from the message, but I cannot find exact text there, which is located in https://github.com/borkdude/clj-kondo/blob/36c0e7ce65521c0b7eb3a09c787ddf7e9b6d4219/src/clj_kondo/impl/linters.clj
I suppose the first person to get their funky macro shape into kondo wins. The trick is to identify a popular macro that doesn't work in kondo with any existing vars, and then name make a library with (defmacro dominic-rules)
and then add that to kondo. Then when users of the popular library add the macro alias, they will add it as popular/library dominic-rules
. ;)