eastwood

All things realted to eastwood - the Clojure linter
gzmask 2018-11-15T20:46:28.010200Z

Do you guys know why my unused-meta-on-macro warning is reporting upon the wrong line numbers?

2018-11-15T20:50:50.010600Z

If it is line number 1, that is common for lots of warnings to show that instead of something more usefu.

2018-11-15T20:51:11.011100Z

If there are macros involved, the line numbers and even file name may be from a different file, if the macro is defined in another file.

2018-11-15T20:51:29.011600Z

If a macro in the same file, line numbers might be from that macro definition rather than from where the macro is called.

2018-11-15T20:51:57.012200Z

If you are hitting some case other than those, I haven't tried digging in to such a case yet.

gzmask 2018-11-15T20:56:45.012600Z

:yell-at @ macros

2018-11-15T20:58:06.013100Z

Are the line numbers you are seeing for a macro definition, rather than where it is used? Or is it less easily explained than that?

gzmask 2018-11-15T22:35:27.014200Z

it prints src/com/somefile.clj:173:70: unused-meta-on-macro: Macro invocation of 'clojure.core/let' has metadata with keys (:tag) that are almost certainly ignored. when the file has only 100 lines

gzmask 2018-11-15T22:40:30.014600Z

also clj -A:eastwood appears to be not working, gives

Exception in thread "main" java.lang.NullPointerException
	at clojure.core$apply.invokeStatic(core.clj:657)
	at clojure.main$main_opt.invokeStatic(main.clj:317)
	at clojure.main$main_opt.invoke(main.clj:313)
	at clojure.main$main.invokeStatic(main.clj:424)
	at clojure.main$main.doInvoke(main.clj:387)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:702)
	at clojure.main.main(main.java:37)

2018-11-15T23:11:34.016200Z

If you have a reproducible case with Clojure source code you are able to share publicly, someone may be able to try to dig in and find out what is going on, if they are interested in digging in. I don't know if the case you are hitting has an easy, difficult, or impossible fix.

2018-11-15T23:12:06.016700Z

I have not use the clj tool to run Eastwood yet, so not sure what the root cause of that exception may be.

2018-11-15T23:12:18.016900Z

Sorry, I'm not being very helpful today.

gzmask 2018-11-15T23:22:52.018Z

I see, thanks. I know the cause of the error now. But it’s sad that I can’t either subpress unused-meta-on-macro in eastwood config file.