-
-
Notifications
You must be signed in to change notification settings - Fork 292
Closed
Description
- I have read the Clojure etiquette and will respect it when communicating on this platform.
version
; clj-kondo -version | head -n 1
clj-kondo v2025.01.16
macro usage
Yes
platform
macos, homebrew
problem
When discouraging clojure.core/read-string
, macroexpanding a macro, and using a tagged literal within that macro, a read-string warning is presented.
repro
echo '(ns foo (:require clojure.template)) (clojure.template/do-template [_] #a/b 1 2)' | clj-kondo --config '{:linters {:discouraged-var {clojure.core/read-string {}}} :hooks {:macroexpand {clojure.template/do-template clojure.template/do-template}}}' --lint -
config
{:linters
{:discouraged-var {clojure.core/read-string {}}}
:hooks
{:macroexpand {clojure.template/do-template clojure.template/do-template}}}
source code
(ns foo (:require clojure.template))
(clojure.template/do-template [_] #a/b 1 2)
expected behavior
No warning is displayed about read-string.
additional info
From @borkdude on Slack:
I don't think this is related to do-template at all but something in rewrite-clj
user=> (rewrite-clj.node/sexpr (p/parse-string "#bar/x []"))
(read-string "#bar/x []")
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done