This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-10
Channels
- # announcements (1)
- # asami (44)
- # babashka (62)
- # beginners (84)
- # calva (42)
- # cider (5)
- # clj-kondo (32)
- # cljs-dev (8)
- # clojure (61)
- # clojure-australia (3)
- # clojure-berlin (1)
- # clojure-europe (12)
- # clojure-japan (3)
- # clojure-nl (4)
- # clojure-serbia (5)
- # clojure-spec (1)
- # clojure-uk (9)
- # clojurescript (31)
- # community-development (21)
- # conjure (5)
- # cursive (17)
- # datomic (14)
- # emacs (10)
- # etaoin (1)
- # figwheel-main (1)
- # fulcro (9)
- # garden (5)
- # graalvm (16)
- # helix (7)
- # honeysql (13)
- # jackdaw (25)
- # jobs (2)
- # lsp (21)
- # malli (25)
- # missionary (2)
- # mount (3)
- # off-topic (12)
- # practicalli (3)
- # re-frame (43)
- # reagent (45)
- # reitit (36)
- # releases (6)
- # remote-jobs (2)
- # reveal (28)
- # rewrite-clj (7)
- # shadow-cljs (45)
- # slack-help (4)
- # spacemacs (5)
- # sql (23)
- # startup-in-a-month (7)
- # tools-deps (59)
- # vim (26)
I have one more question related to clj-kondo
lint-as
for plumbing.core
I have tried to apply this configuration
:lint-as {plumbing.core/defnk clojure.core/defn
plumbing.core/letk clojure.core/let}
and as result I get syntax linter error “error: unsupported binding form :events” for
(defnk init [[:events on-select-fn :as events] path]
and “error: unsupported binding form :results” for
(letk [[[:results {result nil} {nextCursorMark nil}]] results]
@borkdude is it expected or it is a bug similar to what was solved yesterday for plumbing.core/?>
?If you want to have proper support for these macros you will have to write a hook. https://github.com/borkdude/clj-kondo/blob/master/doc/hooks.md You can contribute it to https://github.com/clj-kondo/config for sharing the hook with others. The other way is to simply ignore unresolved bindings in these macros.
by ignore do you mean configure somehow clj-kondo to ignore them?
thanks, it is actually what we are doing right now. I’ll try to look on hooks for the better solution to fix the problem
Actually :unresolved-symbol {:exclude [(plumbing.core/defnk)]}
generates new unresolved-symbol errors for declarations inside (defnk fn [])
So probably only hooks are the rescue when plubming.core
is used 😞
@vguzar Can you give me a repro of this? I think you should always be able to suppress warnings using config
@borkdude sorry I have wrongly described the error. When :unresolved-symbol {:exclude [(plumbing.core/defnk)]}
is used everything that is declared using defnk
of letk
became unresolved symbol. For example for all usages of declared request-async
(defnk request-async [{method :get} {headers nil} url {payload nil}])
you’ll get error: Unresolved symbol: request-async
@vguzar Ah, for this we have:
{:lint-as {plumbing.core/defnk clj-kondo.lint-as/def-catch-all}}
lint-as def-catch-all will use the first symbol as the var name and won't warn about anything else in that defn-like macro
thanks, that could be a rescue let me try
works perfectly, thank you one more time
sorry for bothering but one error related to `
:unresolved-symbol
which is bothering me and I cannot understand. For this code
(defn set-channels [search {:keys [channel static-channels]
:or {channel (:channel search)}}]
clj-kondo complains with error: Unresolved symbol: search
The syntax seems to be ok and code is working as it should, any ideas what is wrong here?@vguzar There is an issue about this here: https://github.com/clj-kondo/clj-kondo/issues/916 and https://github.com/clj-kondo/clj-kondo/issues/782 I think this should be supported but was considered not supported in Clojure at one point, but this viewpoint has changed.
oh, thanks
Another issue with :unresolved-symbol
related to anonymous methods #()
and metadata. In this case
#(let [status (.getStatus ^clj %)])
I got an error error: Unresolved symbol: clj
Didn’t get the same for regular function definition (fn [^clj xhr]
actually it is a good a question 🙂 I would try to get an answer. Could it influence the fix for linter. I see it used in many places in regular fn
but linter is complaining only about anonymous function
Anyone have an example of a .clj-kondow/config.edn
configured for reagent macros to share?
I think only with-let
needs to be configured: https://github.com/reagent-project/reagent/blob/master/.clj-kondo/config.edn#L1
I think only with-let
needs to be configured: https://github.com/reagent-project/reagent/blob/master/.clj-kondo/config.edn#L1