Fork me on GitHub
#clj-kondo
<
2020-08-21
>
snoe14:08:32

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)

borkdude14:08:11

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

snoe14:08:20

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.

borkdude14:08:27

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

snoe14:08:37

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.

borkdude14:08:44

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

👍 3
borkdude14:08:46

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

👍 3
snoe14:08:31

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

borkdude14:08:30

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