clj-kondo

https://github.com/clj-kondo/clj-kondo
snoe 2020-08-21T14:24:32.014800Z

I'm having difficulty figuring out if kondo will lint unresolved-symbols on required namespaces. I've got my cache updated, and I would expect str/bar to be unresolved.

(ns foo
  (:require [clojure.string :as str]))

(str/bar)

borkdude 2020-08-21T14:47:11.016700Z

@snoe clj-kondo doesn't do that, to prevent false positives.

snoe 2020-08-21T14:47:20.017100Z

Another question, is it possible for uneval #_ to follow the :skip-comments rule? This seems inconsistent to me, but maybe there's another flag I couldn't find.

borkdude 2020-08-21T14:47:46.017800Z

there is an issue about it, could be an option I think (unresolved symbols of known namespaces)

👍 1
snoe 2020-08-21T14:48:31.018Z

I might take a look at it then. It seems with :exclude rules false positives could be eliminated per project

borkdude 2020-08-21T14:49:07.018200Z

https://github.com/borkdude/clj-kondo/issues/634

borkdude 2020-08-21T14:49:30.018600Z

Yes. Unresolved symbol linter could take fully qualified symbols I guess

borkdude 2020-08-21T14:50:27.018800Z

The idea here is that one usually evaluates code in a rich comment block, but #_ is just for eliminating code more easily than with ;;

snoe 2020-08-21T14:53:37.019Z

Right, so when our team comments out code with #_ it's usually to keep that code around for a reason (otherwise we'd delete it), and the unused namespaces lints trigger, or signatures change and the commented block gets missed.

borkdude 2020-08-21T14:54:44.019200Z

we could make that opt in I guess, with :lint-unevals or something.

👍 1