Fork me on GitHub
Chris McCormick09:11:14

truestory 4
❤️ 6
😆 8

is there a way to exclude an unused binding by name, regardless of ns (typically "this")


I want to avoid replacing by this or everywhere


and create giant diffs


(so via clj-kondo config would be better)


@mpenet currently not. this is all the config that is possible currently: If this is important for passing CI or git post-commit hooks, then you can turn that linter off for now perhaps using an extra configuration that you don't use in your editor. Feel free to create an issue about this.


I imagine that could be done generically for defrecord/reify/deftype etc bodies


:ignore-self-referencing-arg or something


Hey, I sometimes switch branches. Some namespace api changes and even after having evaled calling site as well as the changed ns, I am still stuck with unresolved var or some changed arity issue. I am using your flycheck integration. Is this a known issue?

Joshua Suskalo18:11:12

the easiest way to deal with this is to delete the .clj-kondo/.cache directory

Joshua Suskalo18:11:37

You could configure magit to do that automatically on checkout


Perhaps clojure-lsp will also fix that automatically by reindexing changed files (cc @ericdallo)


ok. So the current solution is the magit checkout hook?


or run clj-kondo --lint src on checkout


to update changed sources


which is probably better than throwing away your entire cache

👌 3

this is a known bug on clojure-lsp side, we are currently ignoring didChangeWatchedFiles notifications from client which happens when user change the files outside the editor (using git for example)


@borkdude that's related with my clj-kondo feature request of allowing to pass multiple input texts during lint I mentioned some weeks ago, I need to open the issue yet 😔


from out DM: I found something to improve clojure-lsp performance during content changes that should fix some issues and I'd like to include not on the release of this week but on the next, but I found I can't make it work with current clj-kondo api the issue is that ATM clojure-lsp calls clj-kondo in 2 possible ways: • when analyzing external classpath or project sourcepaths, calling clj-kondo to scan a list of filenames • when any code is changed, calling clj-kondo with `:lint ["-"]` passing the buffer text as stdin I'm refactoring and improving the later, if someone change a git branch, or for some reason change multiple files multiple times, clojure-lsp call N times clj-kondo, making cpu go crazy obviously, I made some changes that will debounce and group these changes in a single clj-kondo call, but then I just found there is no way to pass multiple "texts" to clj-kondo 😅 I'd need something like:

:filenames ["a.clj", "b.clj" "c.clj"]
:lint ["text a", "text b", "text c"]
or wherever api you think it'd be the best, WDYT? Does that makes sense for you? borkdude  can you explain why you need to pass code + file names which aren't actually files? ericdallo  [9:43 AM] Because the code is not necessarily saved on disk, so we have only the text code and we need to know which URI that text was related borkdude  [9:43 AM] but where does this code come from? I don't understand the use case and would like to know more about it ericdallo  [9:44 AM] It's the code from the editor that was changed for example because of a git branch change borkdude  [9:45 AM] but why can't you just pass the changed file names in this case? ericdallo  [9:46 AM] Because they are not necessarily persisted on disk :/ [9:46 AM] They could be only on user buffer borkdude  [9:46 AM] I see yeah [9:47 AM] ok, can you make an issue? I'll think a little bit more about this. Is this blocking you?


I'll try to create the issue later today


Yes, please do :)


It will also solve an issue I had recently. I worked around it by writing the inputs to temporary files ;)


I see! alright, I should open the issue tonight, thanks!


Ah, the relief of tension...!


hahah, sorry, kind of a crazy week 😅


No problem ;)