Fork me on GitHub
#clj-kondo
<
2020-09-05
>
borkdude11:09:36

I think that issue now mostly looks good. One thing I'm grappling with is how can we have :config-paths in a way that it will work for all users on a project, be it on Windows, mac, Linux, CI. I was thinking we could have some env var interpolation and conditional logic:

["%HOME%/.clj-kondo"  [:when %CI% "/home/deploy/kondo-configs"]]
:-s, but probaaably not

borkdude11:09:00

Silently ignoring non-existing paths probably also works. Not sure about Windows paths combined with Linux paths

borkdude11:09:30

Maybe Windows users should write: "/C/Users/borkdude/.clj-kondo"

borkdude11:09:29

Neh, I guess they are fine with just writing "C:\\Users" since this works both on linux and Windows: (.exists (io/file "C:\\Users")) ;;=> false

borkdude11:09:09

Probably in a team, relative paths are quite common: just put all the shared configs in a dir one or two up

lread13:09:08

Tidbit that may be helpful or not: I think I am remembering correctly, that within the JVM, forward slashes also work on Windows.

borkdude13:09:09

Let me verify that. What I did test is that classpath entries / resources are valid with forward slashes only

borkdude13:09:08

It's so convenient that I can just ssh into my new Windows computer and do:

[email protected] ~ $ /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe lein repl
to spin up a Windows Clojure REPL ;)

borkdude13:09:45

Yep, it works:

user=> (.exists (io/file "C:/Users"))
true

lread13:09:11

Oddly though, I think classpath separators are not automatically translated.

borkdude13:09:26

I'll just not use those

borkdude14:09:48

I guess this is a little bit iffy when on macOS/linux:

user=> (.isAbsolute (io/file "C:/Users"))
false
user=> (.isAbsolute (io/file "C:\\Users"))
false

borkdude14:09:18

So here is the idea in a screenshot:

borkdude14:09:15

@robert-stuttaford @martinklepsch Would also appreciate your feedback since you use the Rum hook code (potentially in multiple projects) - the issue: https://github.com/borkdude/clj-kondo/issues/992

robert-stuttaford15:09:33

@borkdude yes, this is great - we have a repo we put all our developer machine stuff in, adding this along side /.clojure/deps.edn and /.m2/settings.xml would be great!