Fork me on GitHub
#clj-kondo
<
2020-03-31
>
borkdude13:03:47

Created an open collective for those who prefer it over Github sponsors. https://opencollective.com/clj-kondo

👏 12
borkdude13:03:56

thanks @jeroenvandijk / adgoji for the generous contributions

borkdude19:03:25

Any feedback on this PR? https://github.com/borkdude/clj-kondo/pull/826 My thoughts: the name could be clearer. Maybe get-in-single-key? Also I'm not sure: should we turn on this linter by default? Also: could it be generalized to assoc-in, update-in?

tanzoniteblack20:03:31

I never really thought of (get-in x [:k]) an anti-pattern, so I'd probably lean towards turning this linter off if it was turned on by default. But that's of course just my personal opinion, interested to hear what others think

seancorfield20:03:15

@borkdude I would definitely turn this linter on, if it wasn't on by default (as long as it doesn't give false positives). It's fair to extend it to assoc-in but with update-in you need to bear in mind that we didn't have update until Clojure 1.7 so a lot of older code had to have update-in with [:k].

seancorfield20:03:51

Perhaps :single-key-in as the general name for the linter?

👍 8
8
borkdude21:03:13

I'll post your comment in the issue

seancorfield21:03:53

Sorry, wasn't sure whether you wanted the feedback here or in the PR.

borkdude21:03:26

either is fine