Fork me on GitHub
#clj-kondo
<
2023-12-14
>
Alexander Kouznetsov03:12:43

Is it possible to ask clj-kondo to format inline-configs as it copies them using my custom formatter?

borkdude06:12:32

There isn’t a formatter in kondo currently

Alexander Kouznetsov05:12:09

Is it possible to suppress linting summary linting took 14ms, errors: 1, warnings: 1 (especially when there are no errors or warnings)?

1
Alexander Kouznetsov05:12:21

Nevermind, found this undocumented(?) config option {:output {:summary false}}.

👍 1
Alexander Kouznetsov06:12:39

I was looking into how to make clj-kondo work reliably for a subset of files on any commit and any branch and found that I need to always refresh the cache manually before getting the correct output. A simpler version of this is that when I’m linting a particular namespace, I may have no errors and warnings if I’m using cache, but if I set cache to false, I get a lot of warnings. Is there a way to have clj-kondo detect missing cache entries automatically (using clj-kondo.exports or otherwise) so that if the cache is not built or out of date, it would still produce correct linting output?

borkdude07:12:07

Before cloning a project, you can run what is instructed here: https://github.com/clj-kondo/clj-kondo?tab=readme-ov-file#project-setup If you use clojure-lsp then this will happen automatically

Alexander Kouznetsov21:12:55

If refreshing the cache is mandatory for linting to work correctly, sounds like it may be not as important to check in those copied configs as they can be recreated each time? I was looking into the situation where I can check in enough content for clj-kondo to produce the same correct linting result without an extra step. I assumed that checked in copied configs would do that but sounds like it isn’t so?

borkdude21:12:58

it depends. if you continue working on the same branch, then cached results are valid, but if the code suddenly changes due to changing branches, the cache may not be up to date anymore. some people use a git hook for this. clojure-lsp also helps with this

👍 1
borkdude21:12:07

caching works incrementally as you work in your editor. if you do something which breaks that flow, then the cache should likely be re-populated

👍 1