clj-kondo

https://github.com/clj-kondo/clj-kondo
neotyk 2021-02-10T11:31:35.115100Z

@borkdude https://github.com/clj-kondo/clj-kondo/issues/1164 is this something that would be useful?

borkdude 2021-02-10T11:44:28.117600Z

Replied in the issue

neotyk 2021-02-10T11:56:09.117800Z

me also 🙂

borkdude 2021-02-10T11:58:25.118Z

I'll let the issue be open to gather feedback from the community first.

borkdude 2021-02-10T12:15:24.118200Z

If this doesn't end up in clj-kondo eventually you can write a custom hook to handle cond and condp yourself

neotyk 2021-02-10T12:22:14.118400Z

how would I go about writing custom hook, we’ve being bitten in our rear end few times over last days because of condp lacking default case

borkdude 2021-02-10T12:24:49.118600Z

I will write a small one

neotyk 2021-02-10T12:44:34.119400Z

thank you Michiel

borkdude 2021-02-10T12:46:02.119600Z

np. you might have to do some more work to take into account :>>, e.g. filter it out, but if you're not using that this should already be sufficient

serioga 2021-02-10T15:02:14.125300Z

Idea for linting: warn about useless -> in the code like (-> 'x). Sometimes during refactoring I remove all forms in threading macro and miss remaining macro itself.

2021-02-10T15:11:36.125400Z

Maybe also (-> x y)

borkdude 2021-02-10T15:12:44.125600Z

feel free to post an issue

serioga 2021-02-10T15:26:12.125800Z

“Maybe also (-> x y)” NO!

2021-02-10T15:30:30.126Z

Why? That is like (y x) with extra chars.

2021-02-10T15:31:52.126200Z

I'm not talking about when y is a form, that should be fine, but for a symbol or keyword.

serioga 2021-02-10T15:40:09.126800Z

Sometime I would like to emphasize that x is more important in the context than y. Like (f a (-> b xform)). This allows me to place accents. https://clojurians.slack.com/archives/CHY97NXE2/p1612971030126000?thread_ts=1612969334.125300&cid=CHY97NXE2

2021-02-10T15:59:52.127100Z

Interesting, never thought about using it that way. Thanks.