Just noticed this issue:
Can't parse /Developer/workspace/clj-new/src/clj/new/app/deps.edn, No value supplied for key: namespace clj-kondo (syntax)
for this deps.edn
file (which is a template in clj-new
):
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.10.3"}}
:aliases
{:run-m {:main-opts ["-m" "{{namespace}}"]}
:run-x {:ns-default {{namespace}} ; complaining about this
:exec-fn greet
:exec-args {:name "Clojure"}}
...
This is a Stencil template (but Selmer and others use the same syntax). Not sure if it’s possible to work around this since it’s a parsing issue at the EDN level but I thought I’d mention it in case…@seancorfield If the file ends with .edn, clj-kondo will treat it as edn
you can exclude the file in your config
Right, I meant more “Could clj-kondo understand that {{sym}}
is a template var and still parse the file?“.
Also, while you’re here — I just ran across this:
(ns kondo.reducers
(:require [clojure.core.reducers :as r]))
(defn map-test []
(r/map inc [1 2 3 4]))
;^ r/map flagged as an unresolved var
that would require a change in the parser, which imo isn't worth it. the r/map issue will be fixed in the newest clj-kondo which I'm about to release
Oh, good timing on my part then 🙂
Yeah, I figured it wouldn’t be worth fixing the EDN parse issue. I was just curious if anyone else had run into it.
I have run into it myself :)
it's unfortunate that {{ ... }}
is invalid EDN in this case
if only we had some HEREDOC feature in clojure :P (j/k)
(which wouldn’t solve that parsing issue but… 🙂 )
I just had a pain with lein updating the clj-kondo LSP plugin. Turns out I had clj-kondo in my .lein/profiles.clj as well, so it had included an older version for a while.
lein with-profiles -user
fixes this.. 🤦Well, here it is then:
clj-kondo v2021.03.22: no new features, just bug fixes. https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20210322
@seancorfield I guess a quick hack for templates would be to str/replace all {{ ... }}
s with e.g. nil
and then lint it as .edn. But how would you tell clj-kondo that it should do that.