Fork me on GitHub
#tools-deps
<
2020-09-13
>
dominicm13:09:53

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.

seancorfield17:09:11

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.

borkdude18:09:21

same with EDN config, I also use strings as regex in clj-kondo's config in places

kingcode18:09:16

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)

seancorfield20:09:54

@kingcode I don't see that in any of the versions I have installed -- is it possible you've accidentally edited it?

seancorfield20:09:43

Here's what's in my system install deps.edn for that version:

[email protected]:~$ cat /home/linuxbrew/.linuxbrew/Cellar/[email protected]/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 ""}
    "clojars" {:url ""}
  }
}

kingcode20:09:35

@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
;;....
}

seancorfield20:09:16

This is definitely not legal syntax

kingcode20:09:16

OK…<sigh-of-relief> thx for your comments. I probably should remove the R and make the embedded map the entire effective content then?

seancorfield20:09:08

But :aliases should be a top-level key in the overall map.

kingcode20:09:51

Thanks @seancornfield - that makes sense 🙂

dpsutton21:09:05

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?

kingcode21:09:38

woops @dpsutton and @alexmiller Sorry indeed my mistake. The Rebl distro alias example works fine 🙂 Too much staring.

parens 1