This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-29
Channels
- # babashka (54)
- # beginners (24)
- # biff (23)
- # calva (14)
- # catalyst (4)
- # cider (20)
- # clj-kondo (17)
- # clojure (65)
- # clojure-europe (14)
- # clojure-norway (177)
- # clojure-uk (1)
- # clojurescript (11)
- # core-typed (4)
- # cursive (10)
- # datomic (39)
- # emacs (21)
- # gratitude (33)
- # honeysql (8)
- # hyperfiddle (57)
- # introduce-yourself (7)
- # jobs (5)
- # leiningen (17)
- # lsp (6)
- # meander (3)
- # missionary (5)
- # pathom (2)
- # polylith (4)
- # re-frame (7)
- # releases (2)
anybody know what's the proper syntax to lint-as def :^dynamic
{:lint-as {xxx.core/mydef clojure.core/def}}
, here I dont want a normal def, but a dynamic def
so I'm defining my weird def
to lint as normal def, but since I use my-weird-def with earmuffed name always, so I'm actully defining my-weird-def as def :^dynamic
, hope that make sense:slightly_smiling_face:
can you please give an example/repro of what code goes in and what undesired warnings come out?
sure, take this repo for example: https://github.com/teknql/systemic
it has {:lint-as {systemic.core/defsys clojure.core/def}}
, but from usage example its defsys all have earmuffed name.
clj-kondo [earmuffed-var-not-dynamic]: Var has earmuffed name but is not declared dynamic: server
so this case I guess it'd be more proper to lint systemic.core/defsys
as def :^dynamic
i guess
I can't reproduce:
$ clj-kondo --config '{:lint-as {foo/deffoo clojure.core/def}}' --lint - <<< "(ns foo) (declare deffoo) (deffoo ^:dynamic *foo* 1)"
linting took 5ms, errors: 0, warnings: 0
or, if don't want to be warned for defining names with earmuffs that are not dynamic, turn off the linter that does that
$ clj-kondo --config '{:config-in-call {foo/deffoo {:linters {:earmuffed-var-not-dynamic {:level :off}}}} :lint-as {foo/deffoo clojure.core/def}}' --lint - <<< "(ns foo) (declare deffoo) (deffoo *foo* 1)"
linting took 58ms, errors: 0, warnings: 0