leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
chadhs 2020-04-06T11:06:00.016100Z

is it possible to in include a filepath wildcard in a lein alias?

chadhs 2020-04-06T11:06:42.016800Z

goals is to have this in my aliases map "format" ["zprint" "src/**/*.clj"]

chadhs 2020-04-06T11:07:08.017100Z

i end up getting this error however

Unable to process file: src/**/*.clj because: <http://java.io|java.io>.FileNotFoundException: src/**/*.clj (No such file or directory) Leaving it unchanged!

teodorlu 2020-04-06T11:16:19.018400Z

@chadhs is src/**/*.clj shell syntax? I see that ls src/**/*.clj lists Clojure files, with a bit different behavior on Bash and Zsh.

chadhs 2020-04-06T12:01:59.018600Z

@teodorlu yes it is

chadhs 2020-04-06T12:04:27.019300Z

interesting… sh and bash do behave differently than zsh with that

teodorlu 2020-04-06T12:17:08.021500Z

I'd consider either looking into if zprint supports file search itself, or try to make some pipeline. If you want to go for the pipeline approach, something like

find src -iname '*.clj' | xargs echo
could work. When run from Lein, I suspect you'll have to bash -c or similar to get the pipe to work.
bash -c 'find src -iname "*.clj" | xargs echo'

teodorlu 2020-04-06T12:18:20.022600Z

Not sure if it's a good idea to put that thing into a lein alias. You'll be the judge 🙂

chadhs 2020-04-07T10:59:35.025500Z

@teodorlu it’s not pretty but i have a format.sh with this

#!/usr/bin/env zsh

unset CLASSPATH

lein zprint src/**/*.clj*

chadhs 2020-04-07T11:00:08.025700Z

and an alias using lein-shell like this

"format" ["shell" "./format.sh"]

teodorlu 2020-04-07T11:01:02.025900Z

Nice! -- Well, depends on our definition of nice. Glad you got it working 🙂

teodorlu 2020-04-07T11:01:22.026100Z

Seems like a good case for ZSH, actually. As long as ZSH is installed.

chadhs 2020-04-07T11:52:29.026300Z

that’s the rub. not sure if i want to rely on that. it’s on macs by default; so i’ll have to think on that more.

chadhs 2020-04-07T11:54:04.026500Z

goal is pre-commit hook that will format with zprint and then lint with clj-kondo all using dev deps and aliases in project.clj so there’s no reliance on having the os binaries of those tools installed.

teodorlu 2020-04-07T12:10:05.026700Z

Is find preinstalled on macs? I don't think I've found a Linux system missing it.

lein zprint `find src -iname '*.clj'
`

chadhs 2020-04-08T10:46:34.026900Z

yes, since it’s a BSD under the hood. of the utils are a bit different than their GNU counterparts, but yes find is there ^_^

👍 1
arohner 2020-04-06T21:42:50.023400Z

I’m trying to use :pedantic :abort? to make sure I have no ambiguous dependencies, but it doesn’t appear to behave the way I’d like. For example, I currently have

[s3-wagon-private "1.3.3"] -&gt; [com.fasterxml.jackson.core/jackson-core "2.9.9"]
 overrides
[s3-wagon-private "1.3.3"] -&gt; [com.fasterxml.jackson.core/jackson-databind "2.9.10.1"] -&gt; [com.fasterxml.jackson.core/jackson-core "2.9.10"]
but jackson-core is in :managed-dependencies, so I’d expect that there aren’t problems with that dep

arohner 2020-04-06T21:43:24.023800Z

Is there a different way to achieve this?

danielcompton 2020-04-06T23:51:27.025100Z

Not sure if :plugins works with :managed-dependencies?