clj-kondo

https://github.com/clj-kondo/clj-kondo
dominicm 2020-05-01T16:31:41.083500Z

What's the status of carve & cljs? I have some very obviously in-use vars being highlighted by carve.

dominicm 2020-05-01T16:32:43.083600Z

Does it maybe struggle with fns used as vars?

(defn foo [] )

(identity foo)
?

dominicm 2020-05-02T12:37:24.085600Z

@borkdude I think it's upset because I do (defonce init (mount)) to mount the application... which is unused, which then everything is transitiviely unused too...

dominicm 2020-05-02T12:44:08.085900Z

Adding that ns to the ignored ns seems to have sorted it!

borkdude 2020-05-02T12:45:43.086100Z

kewl!

dominicm 2020-05-02T12:46:39.086300Z

40 unused vars to clean up :)

borkdude 2020-05-01T17:46:18.083700Z

When I put this in a file foo.cljs and run carve over it:

(defn foo [])
(identity foo)
it doesn't report anything. But when I remove (identify foo) it reports foo as unused.

borkdude 2020-05-01T17:46:41.083900Z

Invoked as:

clojure -A:carve --opts '{:paths ["/tmp/foo.cljs"]}'

borkdude 2020-05-01T17:47:23.084100Z

so I can't repro what you are saying

borkdude 2020-05-01T21:49:26.084400Z

Responded in the other message. With this code I couldn't repro your problem. If you have another piece of code that can reproduce it, I'd be happy to take another look

dominicm 2020-05-01T22:13:30.084600Z

I will take a look with a real repro, thanks for going so far with it.

dominicm 2020-05-01T22:13:48.084800Z

I suspect it might be due to the use of foreign libs in clojurescript

dominicm 2020-05-01T22:14:11.085Z

So instead of identity, it's a function that uses a npm namespace