Fork me on GitHub
#clj-kondo
<
2021-01-15
>
dominicm09:01:39

We're starting to mark some code as deprecated, and I didn't see any kondo tests for deprecated namespaces. Clojure has hinted at supporting this: https://clojure.atlassian.net/browse/CLJ-706? I'm guessing kondo doesn't by lack of tests.

borkdude09:01:28

clj-kondo does lint deprecated vars, but not deprecated nss. Feel free to create an issue

borkdude09:01:39

oh, I see there is no clear standard for this yet?

dominicm09:01:07

I think there's a clear standard, just no clear impl in clojure itself yet.

borkdude09:01:18

I guess detecting :deprecated true or :deprecated "1.10.1" in the metadata of the ns is sufficient

dominicm09:01:08

Cool, opened :)

borkdude09:01:09

> A warning similar to the one when using a deprecated namespace you mean var right?

delaguardo14:01:39

❯ echo '(defn- foo [x] (when x (foo false)))' | clj-kondo --lint -
linting took 14ms, errors: 0, warnings: 0
this might be a little bit odd false-positive linting result private foo is not used anywhere except in foo’s body compare with that
❯ echo '(defn- foo [x] (when x 1))' | clj-kondo --lint -
<stdin>:1:8: warning: Unused private var user/foo
linting took 11ms, errors: 0, warnings: 1
is it worth to file an issue?

borkdude14:01:00

yeah, I think that warrants an issue. I think carve already handles this correctly