clj-kondo

https://github.com/clj-kondo/clj-kondo
borkdude 2020-09-05T11:06:36.058100Z

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

borkdude 2020-09-05T11:08:00.058700Z

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

borkdude 2020-09-05T11:08:30.059200Z

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

borkdude 2020-09-05T11:11:29.059500Z

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

borkdude 2020-09-05T11:14:09.060500Z

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

lread 2020-09-05T13:34:08.062900Z

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

borkdude 2020-09-05T13:36:09.063600Z

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

borkdude 2020-09-05T13:37:08.064900Z

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

borkdude@DESKTOP-JN2UNTV ~ $ /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe lein repl
to spin up a Windows Clojure REPL ;)

borkdude 2020-09-05T13:37:45.065700Z

Yep, it works:

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

borkdude 2020-09-05T13:37:59.066100Z

thanks

lread 2020-09-05T13:38:11.066300Z

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

borkdude 2020-09-05T13:38:26.066500Z

I'll just not use those

borkdude 2020-09-05T14:07:48.066800Z

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

borkdude 2020-09-05T14:45:18.069Z

So here is the idea in a screenshot:

borkdude 2020-09-05T14:46:15.069900Z

@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-stuttaford 2020-09-05T15:16:33.070900Z

@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!