Fork me on GitHub
#clj-kondo
<
2020-10-16
>
Ahmed Hassan04:10:11

Can't we configure clj-kondo to flag some word or regex? this can flag TODO, FIXME kind of words.

borkdude06:10:29

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

borkdude06:10:15

There is now also org.httpkit.client built in which is also async

Ahmed Hassan21:10:07

Yeah, that was missing piece of bb, I can't thank you enough for everything you're doing for community.

Mikko Harju06:10:50

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>)

Mikko Harju06:10:40

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.

Mikko Harju06:10:58

It doesn't work directly as I have one parameter before the let declarations

borkdude06:10:57

@U32ST9GR5 lint as Clojure.core/fn?

Mikko Harju06:10:32

😮 of course!

Mikko Harju06:10:16

Ah – a minor caveat...

Mikko Harju06:10:51

(m/let-dynamic dynamic-sub
  [data (if sub (re/subscribe sub) (atom nil))

Mikko Harju06:10:12

that does not work since fn cannot have dynamic declarations... Close but no cigar 🙂

borkdude06:10:03

Ah. You can write a hook for it then, or suppress the unresolved symbols

Mikko Harju06:10:30

I'll dig into the hooks, thanks for the tip!

Mikko Harju13:10:41

@U04V15CAJ fixed this with a hook, was very easy. Found a couple of typos in hooks docs, sent a PR to fix them. Thanks!

borkdude13:10:46

{:keys [:node]}
isn't a typo though, it's well supported

nate14:10:18

huh, TIL

Mikko Harju16:10:01

Same for me. TIL.

Mikko Harju17:10:13

Fixed the PR to contain just the path change.

borkdude17:10:21

Merged, thanks

andrea.crotti13:10:30

is there anything around that uses clj-kondo to generate a static callgraph given a codebase?

andrea.crotti13:10:55

and btw I noticed that both clj-kondo and clindex in their analysis return var, but don't know anything about functions for example

andrea.crotti13:10:11

is that a limitation of the underlying analysis library I guess?

borkdude13:10:39

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

andrea.crotti13:10:57

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

andrea.crotti13:10:07

or something else, only macros were distinguished from what I could see

borkdude13:10:50

@andrea.crotti How do you think carve does this?

andrea.crotti14:10:31

yeah I looked at carve as well

andrea.crotti14:10:21

but I can't really see that it distinguishes between variables and functions

andrea.crotti14:10:30

but it probably just doesn't need to

borkdude14:10:21

ah now I see what you mean

borkdude14:10:29

I think if there is no arity information, it's not a function - maybe

andrea.crotti14:10:20

ah ok yeah that already helps