Fork me on GitHub
#clj-kondo
<
2019-11-11
>
borkdude10:11:32

That's quite confusing and happened to me too more than once.

borkdude11:11:02

The namespace local config is mostly for testing, it doesn't support all the options from the normal config. So it's better to put it in .clj-kondo/config.edn anyway

johanwiren11:11:38

Cool, missed about that quote. However, this exposes the underlying problem, that the custom macro injects the first form, giving:

(defmacro injecting-thread-first
  [& body]
  `(-> :inject ~@body))

(injecting-thread-first (arity-2 :y)
                        (arity-2 :foo))

(macroexpand-1 '(injecting-thread-first (arity-2 :y)
                                        (arity-2 :foo)))

=> (clojure.core/-> :inject (arity-2 :y) (arity-2 :foo))
Which is still valid and should (preferrably) be treated as a ->

johanwiren11:11:17

The reason behind this weird macro is that I am writing a custom version of Ogre's macro (https://github.com/clojurewerkz/ogre/blob/master/src/clojure/clojurewerkz/ogre/anon.clj#L12)

borkdude11:11:28

well, lint-as lints a macro literally as ->, not as -> + something else

borkdude11:11:35

I think you might just want to exclude linting for this macro. {:linters {:unresolved-symbol {:exclude [(your.macros/__)]}}}

borkdude11:11:06

and {:linters {:invalid-arity {:skip-args [your.macros/__]}}}

borkdude11:11:48

Thanks for uncovering a bug regarding metadata though 🙂

johanwiren11:11:38

Ah, yes I see now. lint-as will not help me. Going for disabling linting for that one.

johanwiren11:11:46

Thanks for your help and very helpful tool!

borkdude11:11:37

Thank you too. It's really helpful when users report errors instead of just ignoring them, it makes the quality of the linter better every time.

dharrigan17:11:55

hey @borkdude, thanks for the name drop on the cljs podcast re: clj-kondo 🙂

dharrigan17:11:05

it's no effort 🙂

borkdude18:11:10

thanks anyway 😉