Fork me on GitHub
#clj-kondo
<
2022-04-29
>
Braden Shepherdson13:04:35

here's a weird one: this is tickling :redundant-do despite having two things in it at least in CLJ mode https://github.com/metabase/metabase/blob/master/shared/src/metabase/mbql/util.cljc#L672-L676

borkdude13:04:43

@braden.shepherdson cljc files are linted twice, once for each language context

Braden Shepherdson13:04:19

sure, that makes sense. but I'd argue a do is only redundant if it's not needed in any language.

borkdude13:04:20

you're technically correct, but that's not how it currently works

borkdude13:04:44

you could just put :cljs nil there to get rid of the warning

Braden Shepherdson13:04:18

yeah, that works. thanks for the prompt reply.

Noah Bogart17:04:36

(and some-var) throws a single-logical-operand warning (which I just realized is undocumented). How would you feel about a similar check for (-> some-var) and (->> some-var)?

borkdude17:04:25

could work. we could call it :redundant-call or something: a call which just returns its argument

👍 1
wilkerlucio18:04:39

this may be specific enough to be named :redundant-threading?

borkdude18:04:40

yes, we can call it that

wilkerlucio19:04:49

maybe :redundant-thread is simpler

borkdude19:04:32

I suggested that, but it might be confusing since it could also mean (Thread. (fn []))

wilkerlucio19:04:46

humm, makes sense

wilkerlucio19:04:06

although, is that (Thread. (fn [])) ever to be considered a redundant thread?

borkdude19:04:23

good point. and people can just look up what it means of course

wilkerlucio19:04:56

overloading of names, always fun 😛