This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-06
Channels
- # babashka (40)
- # beginners (14)
- # calva (3)
- # cider (7)
- # clerk (40)
- # clj-kondo (8)
- # cljfx (3)
- # clojure (79)
- # clojure-berlin (1)
- # clojure-denver (14)
- # clojure-europe (30)
- # clojure-nl (6)
- # clojure-norway (21)
- # clojure-uk (4)
- # clojurescript (10)
- # conjure (4)
- # data-science (13)
- # emacs (21)
- # events (8)
- # hoplon (7)
- # hyperfiddle (25)
- # lsp (11)
- # matrix (1)
- # off-topic (110)
- # pathom (11)
- # pedestal (7)
- # reagent (13)
- # reitit (16)
- # ring (10)
- # shadow-cljs (6)
- # timbre (3)
- # vim (8)
- # wasm (3)
What do you think about https://github.com/clj-commons/kibit? Do you think it's reasonable to have something like this in Clojure-LSP?
I was wondering what kibit
gave that's better than what already works out of the box.
Both kibit and clojure-lsp warn on this code:
(if (some? [1 2 3]) ; lsp: "Missing else branch. [missing-else-branch]
[:action])
But I don't get any LSP warnings from this code from the kibit README:
(if (some? [1 2 3])
[:action]
nil)
Personally, I'd be interested in getting that warning from LSP. I'm not planning on installing any other static analysis tools than Clojure-lsp any time soon.
Yes, most of the things are done by clj-kondo under the hood, so we could improve kondo if it makes sense c/c @U04V15CAJ
Ah, alright. I only wanted to know whether kibit project is already irrelevant.
I personally don't think we have to warn for:
(if (some? [1 2 3])
[:action]
nil)
A linter is for warning on silly/accidental mistakes, but the above expression seems pretty intentional to me. I'm also not interested in when-not
vs (when (not ..))
etc, these things just make you fight the linter when you're writing code imo.
There is #splint which is a rewrite of kibit which has a lot of these things. The best "linters" I want to have in clj-kondo but probably not all of them. I ported (+ x 1)
vs. (inc x)
for example, which has real benefits. Make clj-kondo issues, upvote existing ones and/or PR, this is how it works.Thanks for the Splint mention, @U04V15CAJ. I mostly agree. Something like Splint and Kibit are good for running manually to see what comes up, but I don't necessarily suggest using them while actively coding because the things they care about can be distracting to the goal of producing correct behavior.
If you do want to get them running in your editor, reach out in #C04SCGV2ATX or in the github tracker and I'll help you set up something separate from clj-kondo or lsp
I think you could re-use flycheck-clj-kondo for example and tweak it so use splint, it's only a few lines of code
for vscode, there's clojure-lint (written by @U0K592YDP) which called out to the clj-kondo binary, same idea