This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-17
Channels
- # announcements (4)
- # beginners (82)
- # boot (1)
- # calva (26)
- # cider (13)
- # clj-kondo (41)
- # cljs-dev (25)
- # cljsrn (7)
- # clojure (82)
- # clojure-berlin (1)
- # clojure-brasil (1)
- # clojure-dev (13)
- # clojure-europe (11)
- # clojure-italy (27)
- # clojure-nl (8)
- # clojure-russia (6)
- # clojure-spec (32)
- # clojure-uk (15)
- # clojurescript (61)
- # core-async (1)
- # cursive (9)
- # data-science (1)
- # datomic (18)
- # duct (1)
- # emacs (2)
- # events (7)
- # fulcro (13)
- # graalvm (5)
- # immutant (1)
- # jobs-discuss (63)
- # leiningen (3)
- # off-topic (48)
- # om (3)
- # pathom (13)
- # planck (20)
- # prelude (3)
- # re-frame (55)
- # reagent (13)
- # reitit (5)
- # rewrite-clj (12)
- # shadow-cljs (67)
- # spacemacs (14)
- # sql (5)
- # tools-deps (4)
- # vim (23)
- # yada (2)
hi, I'm getting false positive in case when using multiarity multimethods (didn't found an issue on github)
(defmulti testmulti (fn [m & _] m))
(defmethod testmulti :some
([_] "zero arity")
([_ _] "unary")
([_ _ _] "binary"))
when def
(or defn
etc.) is emitted by macro:
(defmacro testmacro
[symbol]
`(def ~symbol 11))
(testmacro eleven)
I get: info: unresolved symbol eleven
that can be resolved using the following config:
{:lint-as {foo/testmacro clojure.core/def}}
src\fastmath\regression.clj:98:25: info: unresolved symbol ols
src\fastmath\regression.clj:100:25: info: unresolved symbol rls
src\fastmath\regression.clj:102:25: info: unresolved symbol lasso
src\fastmath\regression.clj:102:39: info: unresolved symbol lambda
src\fastmath\regression.clj:102:46: info: unresolved symbol tolerance
src\fastmath\regression.clj:102:56: info: unresolved symbol max-iters
src\fastmath\regression.clj:108:25: info: unresolved symbol ridge
...
in that case I would use the config:
{:linters {:unresolved-symbol {:exclude [(wrap-regression)]}}}
for vars that are introduced by this macro, you can put in an extra declare
(see example of HugSQL in the linked docs)
or if it just gets too annoying there is a way to turn off the linter in a namespace, but I haven’t documented this yet
@mynomoto since EDN is just a quoted clojure data structure, it could easily do that. What would be your use case for it?
for {:a 1 :a 2}
:
$ clj-kondo --lint /tmp/foo.edn
/tmp/foo.edn:1:7: error: duplicate key :a
linting took 13ms, errors: 1, warnings: 0
but:
{a 1 b 2}
$ clj-kondo --lint /tmp/foo.edn
/tmp/foo.edn:1:2: info: unresolved symbol a
/tmp/foo.edn:1:6: info: unresolved symbol b
linting took 10ms, errors: 0, warnings: 0
so it needs to read it as a quoted value, which would just be a small changeI did open a deps.edn file and clj-kondo warnings were all over it so I wanted to know if this was expected.
but as of now, the editor integration should not lint .edn files. so I wonder which one you’re using
I’m not in control of that plugin. Does ale send the code over stdin or via the filesystem?
@mynomoto I’ll just implement it and let you know as soon as it’s there: https://github.com/borkdude/clj-kondo/issues/270