This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-02
Channels
- # aleph (1)
- # announcements (1)
- # babashka (4)
- # beginners (89)
- # calva (3)
- # chlorine-clover (18)
- # cider (33)
- # clj-kondo (27)
- # cljdoc (4)
- # cljsrn (2)
- # clojure (248)
- # clojure-europe (7)
- # clojure-italy (15)
- # clojure-nl (7)
- # clojure-norway (10)
- # clojure-poland (1)
- # clojure-spec (12)
- # clojure-sweden (5)
- # clojure-uk (57)
- # clojured (4)
- # clojuredesign-podcast (1)
- # clojurescript (55)
- # core-async (14)
- # core-logic (3)
- # cursive (10)
- # datomic (38)
- # figwheel-main (8)
- # fulcro (23)
- # graalvm (126)
- # hoplon (59)
- # jobs (1)
- # kaocha (3)
- # malli (30)
- # meander (17)
- # off-topic (32)
- # pathom (19)
- # pedestal (4)
- # re-frame (12)
- # reagent (2)
- # reitit (3)
- # shadow-cljs (81)
- # sql (9)
- # tools-deps (34)
- # vim (20)
- # vscode (7)
- # xtdb (5)
Is there a way to tell clj-kondo
that a macro is like a let binding?
We have a macro that adds a binding like this:
(with-temp-file filename
(foo (bar filename)))
And clj-kondo warns about the unresolved symbol. I can mark this macro as excluded, but is there a more sophisticated approach?@marc-omorain You can use :lint-as
+ cljs.test/async
(I know, it's weird, but this works)
aha, so cljs.test/async
has the same pattern, gotcha 👏
We have some macros that expect square braces in the same way, and I lint those as fn
I think I’ve found a false positive case in clj-kondo, going to reduce it down now
(fn unresolved-symbol-x
[x & {:keys [y]
:or {y (inc x)}}]
(+ y x))
logging in GH now
We have defined a method called zero?
in our money lib, but now clj-kondo complains because we overwrite zero?
from cljs.core
. Is there a way to white list just these occurrences as OK, possibly similar to rubocop's rubocop:disable
comments? I'd prefer not to disable this linter globally if possible
Clojure 1.10.1
(defn foo [x & {:keys [y] :or {y (inc x)}}]
(+ y x))
#'user/foo
user=> (foo 1 :y 10)
11
user=> (foo 1)
3
@marc-omorain I've had more edge cases where people did weird things with or that accidentally worked but were confirmed by the core team as a thing to not rely on, that's why I'm going to ask in #clojure first
gotcha
@borkdude so pulling circleci/circle
up the latest clj-kondo reported 4 issues.
2 legit bugs, that issue above ^, and a weird case of us abusing name-spaces to break a circular dependency between two namespaces, which clj-kondo
can’t deal with (which I don’t expect it to deal with).
One bug was us passing a vector of 4 items as the last arg to clojure.set/union
. The other was genuine broken code that happens to not crash.
@marc-omorain Cool, so all good now? 🙂
the lsp plugin with intellij doesn't seem to be reading the project's .clj-kondo/config.edn`, is there a way to convince it to do this?
@tanzoniteblack I think this depends on the working directory. so if you edit files within your project while your project is opened in its base directory, then it will probably work
ah, I had to move the config from the module directory I was working in to the project directory, and then restart intellij before it actually kicked in