This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-01
Channels
- # announcements (8)
- # aws (8)
- # babashka (21)
- # beginners (125)
- # calva (12)
- # cider (10)
- # circleci (29)
- # clara (6)
- # clj-kondo (34)
- # cljdoc (3)
- # cljfx (65)
- # cljs-dev (18)
- # clojure (38)
- # clojure-australia (4)
- # clojure-berlin (5)
- # clojure-czech (2)
- # clojure-dev (15)
- # clojure-europe (22)
- # clojure-nl (3)
- # clojure-uk (31)
- # clojuredesign-podcast (7)
- # clojurescript (87)
- # code-reviews (1)
- # conjure (3)
- # cursive (2)
- # data-science (1)
- # datalog (1)
- # datomic (36)
- # emacs (12)
- # events (1)
- # fulcro (3)
- # graalvm (68)
- # instaparse (2)
- # jackdaw (2)
- # jobs (2)
- # leiningen (8)
- # luminus (2)
- # nrepl (31)
- # pedestal (44)
- # releases (1)
- # remote-jobs (6)
- # shadow-cljs (4)
- # spacemacs (4)
- # sql (13)
- # tools-deps (56)
- # uncomplicate (4)
- # xtdb (40)
- # yada (11)
(defn foo
[{:keys [bar baz] :as config}]
...
...do something with bar
...do something with baz
...)
As you notice, config
is not being used, however, it is useful for documenting, as pointed out elsewhere ...two fns that look superficially similar can be immediately distinguished [by looking at the :as]
Current clj-kondo flags config
as not being used. I know I could put an unused var escape before the form or globally, but that's overkill (globally) or noise (individually for each form)
@dharrigan There is a recent issue for this.
I'll try to look (understand) the code base myself today to see if I can contribute
What would the lint-as equivalent be for this macro template/fn
?
; (template/fn args source)
; Example:
(def hello
(template/fn [name] "Hello <%= name %>"))
(hello "Alice")
https://github.com/weavejester/comb
I tried defn but defn has a function name before the argsbut you will get unused bindings with that, since kondo doesn't know about this macro
you can suppress those with #_:clj-kondo/ignore[:unused-binding]
before the (template/fn ...)
call
Is it possible to do something like this:
{:linters {:unused-binding {:exclude [comb.template/fn]}}}
I tried this in my config.edn but it doesn't seem to be workingI'm still new to clojure, but is it not possible to lint macros automatically without supporting them on a case by case basis
clj-kondo doesn't execute your code, so it can't know what your macro does, which is the fundamental problem