I suppose that the new -X stuff can't express regex directly, as it's EDN based. I only mention it because it's one of a handful of types that couldn't be passed to a function directly, and a wrapping string-based function would be needed for use from the CLI.
Yep
Yup, that's what I did for depstar
's --exclude
arg, but the command-line version is also a plain string so both logic paths have to turn it into a pattern.
same with EDN config, I also use strings as regex in clj-kondo's config in places
I’m wondering about this strange syntax in <install-dir>/deps.edn:
{…
{:aliases ...}
R
...
}
So it looks like an embedded deps
map is used as a key pointing at the -R option? How does this work? I couldn’t find this documented anywhere on the clojure site’s Deps and CLI reference. (Using clojure 1.10.1.590)@kingcode I don't see that in any of the versions I have installed -- is it possible you've accidentally edited it?
Here's what's in my system install deps.edn
for that version:
seanc@DESKTOP-30ICA76:~$ cat /home/linuxbrew/.linuxbrew/Cellar/clojure@1.10.1.590/1.10.1.590/deps.edn
{
:paths ["src"]
:deps {
org.clojure/clojure {:mvn/version "1.10.1"}
}
:aliases {
:deps {:extra-deps {org.clojure/tools.deps.alpha {:mvn/version "0.9.745"}}}
:test {:extra-paths ["test"]}
}
:mvn/repos {
"central" {:url "<https://repo1.maven.org/maven2/>"}
"clojars" {:url "<https://repo.clojars.org/>"}
}
}
@seancorfield Sorry, I meant my config dir, not the install.. I think maybe installing rebl recently caused a bad edit - here is the effective content of .clojure/deps.edn:
{ ;...
{:aliases
{:rebl ;; for JDK 11+
{:extra-deps {com.cognitect/rebl {:mvn/version "0.9.241"}
org.openjfx/javafx-fxml {:mvn/version "15-ea+6"}
org.openjfx/javafx-controls {:mvn/version "15-ea+6"}
org.openjfx/javafx-swing {:mvn/version "15-ea+6"}
org.openjfx/javafx-base {:mvn/version "15-ea+6"}
org.openjfx/javafx-web {:mvn/version "15-ea+6"}}
:main-opts ["-m" "cognitect.rebl"]}
:rebl-jdk8 ;; for JDK 8
{:extra-deps {com.cognitect/rebl {:mvn/version "0.9.241"}}
:main-opts ["-m" "cognitect.rebl"]}}}
R
;;....
}
This is definitely not legal syntax
Agreed :)
OK…<sigh-of-relief> thx for your comments. I probably should remove the R and make the embedded map the entire effective content then?
Hard to say. My ~/.clojure/deps.edn
looks like this: https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn
But :aliases
should be a top-level key in the overall map.
Thanks @seancornfield - that makes sense 🙂
Aliases always go in a map with the other aliases. That example is correct. And your deps.edn locally will largely look the same yes?
woops @dpsutton and @alexmiller Sorry indeed my mistake. The Rebl distro alias example works fine 🙂 Too much staring.