@borkdude Is it possible to tell carve to ignore a clj file, instead of some symboles
@i carve has :api-namespaces
where it won't look at public unused vars, maybe this works for you?
it uses the name of the namespace, not the filename
Is this the correct form?
{:api-namespaces ['mocks]}
❯❯❯ clojure -M:carve --opts '{:paths ["src"]}'
Carving src/mocks.cljs
Found unused var:
------------------
(def action-button #js {:default #js {:Item #js {}}})
------------------
Type Y to remove or i to add mocks/action-button to .carve/ignore
Still got the above output.
clj-kondo doesn’t catch unused variables? How to configure it?
variables = vars?
clj-kondo itself doesn't have that feature, but it's available as part of its analysis output
you can use clojure-lsp lens-mode if you want to display usages inline in your editor, which uses this analysis
Yup. I was trying to use carve. And suddenly got aware that clj-kondo has the unused feature covered: https://github.com/clj-kondo/clj-kondo#features
So what DIRECT feature is supported by clj-kondo?
Looking at the test sample: https://github.com/borkdude/carve/blob/f499f65e36e02484609f01ce891f3c0207b24444/test/carve/main_test.clj#L66
clj-kondo only reports unused private vars, not unused public vars
but clojure-lsp does
the {:api-namespaces [’mocks]} should be correct. But it doesn’t work on my side.
where did you put this?
in an EDN file you should not use the quote
Thanks. Removing the quote makes it work.
Is it possible to instruct carve to ignore all clj files that has the name of xxx_test.clj ?
@i carve should already ignore deftest
vars
Thanks. That’s the case.