Fork me on GitHub
#clj-kondo
<
2022-09-26
>
Noah Bogart02:09:32

Makes sense to be cautious. Do people upgrade the clj-kondo in their CI without first checking? That seems dangerous to me

šŸ‘ 1
lread02:09:55

Iā€™m a bit on the extreme side and run it a specific version from the JVM for CI via a deps.edn dep

lread02:09:29

But also excitedly try out each new version!

ericdallo13:09:13

Clojure-lsp bumps clj-kondo all the time, which affects lint as well

Noah Bogart13:09:02

ah yeah, clojure-lsp is a good point, that does keep up pretty actively.

lread14:09:49

Yeah I appreciate all the up-to-date goodness that clojure-lsp brings to me in my editor. For CI, I want repeatability.

borkdude08:09:08

@dpsutton Do you mean something like :experimental true and then after a while the experimental linters become default linters?

skylize12:09:17

> soon-to-be-default linters "Experimental" sounds to me like ... well, experimental. I would have no expectations of a linter described as experimental even being complete, much less destined to be a default. I think the request is more like :planned-defaults true, to get an early jump on linters that you definitely hope to enable for everyone after some battle-testing. (Also gives people a heads up on such plans, so they can chime in with possible reasons to never default some particular linter.)

borkdude12:09:36

Meh, I think it might be sufficient to just keep future linters all optional and if people want to use them, they can do that

robert-stuttaford11:09:23

shadow-cljs and kaocha both use the concept of a file-system watcher to trigger build and test runs. is it possible to run clj-kondo in this manner, so as to benefit from running it as a warm process? duh, of course it's possible. what i meant is, is anyone doing it and can i have your code please? šŸ˜… why i am asking: i want to run kaocha, shadow and kondo-in-watch-mode all at the same time as i move a whole bunch of namespaces around. this way, i can watch one set of terminals and see all the feedback together, without having to browse files in my editor

borkdude11:09:19

you can write a bb script which watches your sources and runs clj-kondo

robert-stuttaford11:09:08

hah! we already have one. so all i need is to add the watcher. simple! thanks @borkdude

robert-stuttaford12:09:00

how i force a bb script to stay running?

borkdude12:09:06

The promise that never gets delivered :)

šŸ‘ 2
robert-stuttaford12:09:30

ah darn of course!

robert-stuttaford12:09:42

got it working thanks @borkdude!

šŸŽ‰ 1
borkdude12:09:58

Feel free to add something to the clj-kondo wiki: https://github.com/clj-kondo/clj-kondo/wiki

borkdude16:09:45

Sure. It might have been nice to show the code in a different buffers so you don't get the clj-kondo lint warnings šŸ™ˆ

borkdude16:09:03

An animated gif might be even more awesome where you can see you can navigate :-D

robert-stuttaford17:09:46

haha i haven't unlocked the make a gif achievement yet šŸ˜„

borkdude17:09:57

Try Cmd-shift-5 in macOS or download licecap :)

snoe20:09:00

@borkdude would it be worth shipping kondo with these hooks? datomic and malli are at least as popular as re-frame.

borkdude20:09:16

I'd rather not ship any built-in stuff if it can be done in libraries. In the beginning it was a necessity but this is no longer true

borkdude20:09:04

I've had a lot of churn in the re-frame stuff with edge cases which led to releasing new versions of clj-kondo, which is not a problem you have when you do it in libs

snoe20:09:47

oh right, so a PR for the hook could be added to malli and --copy-configs used in projects that depend on it. In theory, the same should be done for re-frame

borkdude20:09:50

exactly, but we already had re-frame built-in

snoe20:09:22

so @robert-stuttaford that could be a way to contribute to the ecosystem if you're interested.

borkdude20:09:31

good luck contributing to datomic tho :)

snoe20:09:32

yeah šŸ˜ž.would clj-kondo/config be usable as a contrib for uncooperative libraries?

borkdude20:09:35

yeah, I am considering chopping up clj-kondo/config into multiple libraries, so you can just include extra libraries on your classpath to get configs

ā¤ļø 2
Noah Bogart18:09:07

i'd like to ensure that every test file requires a specific test setup file that does some side-effecting set up. i could do this in a hook, i think, but would there be any interest in adding this as an official linter rule?

Noah Bogart19:09:47

it seems that :macroexpand hooks aren't used when checking dependencies. is there a way to use a locally defined :macroexpand hook on dependencies?

borkdude19:09:57

clj-kondo doesn't really distinguish between your code and dependency code. hooks are always executed

Noah Bogart19:09:50

I must have an error in my code then, thanks

Noah Bogart20:09:11

ah, it was a caching issue. I should have checked that first. Thanks

šŸ‘ 1