From 09701bf521f094956bf40ab77ba0b7dfe179a78e Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Tue, 1 Sep 2020 10:42:53 +0200 Subject: [PATCH] [#981] Aliased keyword not detected in quoted forms --- src/clj_kondo/impl/analyzer.clj | 7 ++++++- test/clj_kondo/main_test.clj | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/clj_kondo/impl/analyzer.clj b/src/clj_kondo/impl/analyzer.clj index 736679e395..18e6e9920e 100644 --- a/src/clj_kondo/impl/analyzer.clj +++ b/src/clj_kondo/impl/analyzer.clj @@ -1616,7 +1616,12 @@ children)) :fn (recur (assoc ctx :arg-types nil) (macroexpand/expand-fn expr)) - :token (when-not (or (:quoted ctx) (= :edn (:lang ctx))) (analyze-usages2 ctx expr)) + :token + (if (:quoted ctx) + (when (:k expr) + (usages/analyze-keyword ctx expr)) + (when-not (= :edn (:lang ctx)) + (analyze-usages2 ctx expr))) :list (if-let [function (some->> (first children) diff --git a/test/clj_kondo/main_test.clj b/test/clj_kondo/main_test.clj index 34712e2a78..ab48853488 100644 --- a/test/clj_kondo/main_test.clj +++ b/test/clj_kondo/main_test.clj @@ -1759,7 +1759,8 @@ foo/foo ;; this does use the private var (is (empty? (lint! "(def x) (doto x)"))) (is (empty? (lint! "(def ^:private a 1) (let [{:keys [a] :or {a a}} {}] a)" {:linters {:unused-binding {:level :warning}}}))) - (is (empty? (lint! "(scala.Int/MinValue)" {:linters {:unresolved-symbol {:level :error}}})))) + (is (empty? (lint! "(scala.Int/MinValue)" {:linters {:unresolved-symbol {:level :error}}}))) + (is (empty? (lint! "(require '[clojure.string :as s]) '::s/foo")))) (deftest proxy-super-test (is (empty? (lint! "