clj-kondo

https://github.com/clj-kondo/clj-kondo
robert-stuttaford 2020-06-03T09:04:51.313300Z

sweeet will definitely do so πŸ‘

borkdude 2020-06-03T09:06:39.314Z

still thinking about an idea how macro writers can expose this kind of config in their libs so it can be detected by clj-kondo using some classpath scanning logic

borkdude 2020-06-03T09:09:25.314400Z

maybe that should be left out of scope for the initial release of this

robert-stuttaford 2020-06-03T09:12:55.314800Z

how do i install the version of clj-kondo that has this capability, @borkdude?

borkdude 2020-06-03T09:13:34.315500Z

@robert-stuttaford I can provide you a link to a binary or you can check out the source + branch and run it with clojure -A:clj-kondo --lint ...

robert-stuttaford 2020-06-03T09:14:05.315700Z

ok great i'll try the source thing first

robert-stuttaford 2020-06-03T09:14:08.316Z

shot!

borkdude 2020-06-03T09:14:46.316300Z

@robert-stuttaford The branch is macros-sci

robert-stuttaford 2020-06-03T09:14:47.316400Z

which branch is it πŸ˜„

robert-stuttaford 2020-06-03T09:14:53.316800Z

zing!

robert-stuttaford 2020-06-03T09:17:37.317200Z

hmm i think i may need to try the binary, @borkdude

borkdude 2020-06-03T09:17:50.317400Z

why's that?

robert-stuttaford 2020-06-03T09:18:39.318200Z

so that i can test it the way i use it, in emacs, for the whole project, to eliminate unrelated issues due to testing it this way

robert-stuttaford 2020-06-03T09:18:51.318500Z

is that straightforward to do?

robert-stuttaford 2020-06-03T09:19:07.319Z

i should be able to put that config into .clj-kondo/config.edn right?

borkdude 2020-06-03T09:19:46.319800Z

makes sense. you can also try to build it. it's relatively straightforward if you download GraalVM, but I can also save you the trouble by providing new links every time you want to try new commits

robert-stuttaford 2020-06-03T09:20:12.320300Z

if there's a how-to i can follow, i'm happy to try do that myself πŸ™‚

borkdude 2020-06-03T09:20:43.321Z

yes. the code goes to :macroexpand {macrons/macroname "(fn ....)" but the string can also contain the path of a file that's in the .clj-kondo dir.

borkdude 2020-06-03T09:21:45.321900Z

Let me update it with the latest used GraalVM version. It should be java8-19.3.1

robert-stuttaford 2020-06-03T09:22:02.322300Z

great thanks - i'll probably only get to this over the weekend!

borkdude 2020-06-03T09:23:06.322500Z

updated

robert-stuttaford 2020-06-03T09:23:44.322700Z

thank you πŸ™‚

Marc O'Morain 2020-06-03T09:46:27.323700Z

We have a namespace with two vars like this:

(defn- identity->Identity
...
(defn- Identity->identity
This causes problems with AOT and calling compile as far as I can tell, since the class files generated have the same names. This might be a nice lint warning for Kondo.

borkdude 2020-06-03T09:47:37.324200Z

ok, issue welcome

dominicm 2020-06-03T11:32:41.324600Z

That seems like a clojure bug

dominicm 2020-06-03T11:34:01.325600Z

@marc-omorain https://cemerick.com/2010/08/19/case-insensitive-filesystems-vs-aot-compiled-clojure/ looks like you need to have a case sensitive filesystem. This won't affect a lot of people.

dominicm 2020-06-03T11:34:12.326100Z

It's an operating system issue somewhat.

Marc O'Morain 2020-06-03T11:37:53.327Z

Don’t macOS and Windows have case-insensitive filesystems by default? My mac certainly does.

$ touch foo; touch Foo; ls | grep -i foo
foo

Janne Sauvala 2020-06-03T11:52:46.327100Z

My work macos has APFS (Encrypted), even tho there should be an option for APFS (Case-sensitive, Encrypted). So looks like they are by default case-insensitive https://support.apple.com/en-gb/guide/disk-utility/dsku19ed921c/mac

borkdude 2020-06-03T12:45:59.328800Z

Any users that experienced a problem in VScode / Calva + clj-kondo's config when opening files from other projects external to the main project directory, this should now be resolved in extension version 2020.5.90.

1🀘
2020-06-03T15:04:17.332700Z

Hi everyone, I'm trying to integrate clj-kondo into Spacemacs, In the docs there are two sets of instructions for develop and master branch (but there is no such branch anymore). Which is the default way now to integrate it into spacemacs ?

borkdude 2020-06-03T15:06:18.333200Z

probably asking in the #spacemacs channel is the best, since there's the most people using it

borkdude 2020-06-03T15:06:29.333400Z

although there might also be some of them here

2020-06-03T15:07:00.333500Z

Thanks

2020-06-03T15:10:18.333800Z

hmm ... do you mean that by branch in that section of docs they mean spacemac's clojure layer's branch not clj-kondo's?

borkdude 2020-06-03T15:11:56.334Z

spacemacs runs clj-kondo as a binary, so there is not a branch of clj-kondo that's applicable to that config

borkdude 2020-06-03T15:12:04.334200Z

I don't remember the docs, I didn't write those

borkdude 2020-06-03T15:12:16.334400Z

@jr0cket?

practicalli-john 2020-06-03T15:15:22.336300Z

@ho0man I strongly recommend using Spacemacs develop branch, it has all the fixes and enhancements over the last couple of years. If you look at the Spacemacs home buffer, SPC b h it will show you which Spacemacs version you are on. If you are on 0.200, its master and 0.300 it is develop. If you want to switch over to develop, here are my recommended steps https://practicalli.github.io/spacemacs/install-spacemacs/switch-to-develop.html

3βž•
2020-06-03T15:17:58.336600Z

Thanks a lot @jr0cket

1πŸ‘
2020-06-03T15:18:14.336800Z

Thanks @borkdude

snoe 2020-06-03T20:32:15.342900Z

@borkdude in macros-sci does the analyzer get insight into the macro forms? i.e would it be able to determine the position of the declaration of x is? (mydef x 1) x => {:col 8} ?

borkdude 2020-06-03T20:33:02.343400Z

@snoe yes, it's metadata on the symbol

1πŸ’―
borkdude 2020-06-03T20:37:45.344400Z

@snoe how it works: the rewrite-clj nodes are converted into sexprs, location metadata gets stored onto the sexprs. so for lists, symbols, that works. for numbers, it doesn't.

borkdude 2020-06-03T20:38:17.345200Z

and then you generate a new sexpr and fix the metadata accordingly. e.g. when you return a new list, you use with-meta to put the original location on that

1πŸ˜„