jonase / eastwood

Clojure lint tool
1.09k stars 66 forks source link

Add posibility to configure def-in-def #445

Closed zikajk closed 1 year ago

zikajk commented 1 year ago

Hi, I would like to disable warnings for def-in-def when they are used inside specific macro. This seems not to be possible right now. The motivation is this library: https://github.com/borkdude/deflet

vemv commented 1 year ago

Hi!

I'll check this out soon. There's an omission mechanism named if-inside-macroexpansion-of. I don't recall if it works for def-in-def.

https://github.com/jonase/eastwood#ignored-faults works for every linter though, so you could use that if having a red build.

Cheers - V

zikajk commented 1 year ago

I have tried

(disable-warning
 {:linter :def-in-def
  :if-inside-macroexpansion-of #{'borkdude.deflet/deflet}})

but it fails with Unknown error: java.lang.IllegalArgumentException: No matching clause: :def-in-def

Thank you!

vemv commented 1 year ago

Yes, probably it's not implemented for that linter. It tends to be easy to make it compatible.

vemv commented 1 year ago

https://clojars.org/jonase/eastwood/versions/1.4.0 has been released.

Cheers - V

zikajk commented 1 year ago

Great, thanks a lot!