Can't we configure clj-kondo to flag some word or regex? this can flag TODO, FIXME kind of words.
Yeah, that was missing piece of bb, I can't thank you enough for everything you're doing for community.
Hi! What would be the best way to lint a "let-like" macro that has the following signature:
(m/dynamic-let <var> <let-declarations> <body>)
@borkdude fixed this with a hook, was very easy. Found a couple of typos in hooks docs, sent a PR to fix them. Thanks!
nice :)
{:keys [:node]}
isn't a typo though, it's well supportedhuh, TIL
Same for me. TIL.
Fixed the PR to contain just the path change.
Merged, thanks
NP!
I mean, I can just ignore the unresolved symbols altogether, but I'm interested if I could somehow piggyback on the let-declaration to get linting on the body based on the let-declarations.
lint-as
https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#enable-optional-linters-1
It doesn't work directly as I have one parameter before the let declarations
@mikko lint as Clojure.core/fn?
😮 of course!
Ah – a minor caveat...
(m/let-dynamic dynamic-sub
[data (if sub (re/subscribe sub) (atom nil))
that does not work since fn cannot have dynamic declarations... Close but no cigar 🙂
Ah. You can write a hook for it then, or suppress the unresolved symbols
I'll dig into the hooks, thanks for the tip!
Btw I remember that you once used babashka for a lot of requests with bb curl right? And this created too many processes on your machine
There is now also org.httpkit.client built in which is also async
is there anything around that uses clj-kondo to generate a static callgraph given a codebase?
and btw I noticed that both clj-kondo and clindex in their analysis return var, but don't know anything about functions for example
is that a limitation of the underlying analysis library I guess?
not sure what you mean with "don't know anything about functions" but the above library utilizes clj-kondo for making callgraphs, so yes, it's possible
I mean that you get var-definitions and var-usages, but I could not see how to say if a var referred to a function
or something else, only macros were distinguished from what I could see
@andrea.crotti How do you think carve does this?
yeah I looked at carve as well
but I can't really see that it distinguishes between variables and functions
but it probably just doesn't need to
ah now I see what you mean
I think if there is no arity information, it's not a function - maybe
ah ok yeah that already helps