This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-13
Channels
- # announcements (1)
- # babashka (28)
- # beginners (72)
- # biff (6)
- # calva (15)
- # clerk (14)
- # clj-otel (4)
- # cljdoc (4)
- # clojure (121)
- # clojure-europe (61)
- # clojure-nl (2)
- # clojure-norway (63)
- # clojure-uk (5)
- # datahike (35)
- # datalevin (37)
- # datomic (7)
- # emacs (2)
- # fulcro (6)
- # gratitude (1)
- # honeysql (2)
- # hyperfiddle (38)
- # malli (9)
- # matrix (24)
- # meander (4)
- # off-topic (10)
- # polylith (8)
- # reagent (2)
- # releases (1)
- # shadow-cljs (8)
- # spacemacs (4)
- # specter (1)
- # squint (5)
- # tools-deps (3)
What's the preferred beginner-friendly way of getting clj-kondo to lint files in a Getting Started / standalone REPL? As far as I can tell, it's only possible to start a clojure-lsp server in a pre-existing project folder
Hi! This is unsolved territory. The solution may be to add an option for creating a proper getting started project. Which is on my todo since a while for other reasons too.
Got it - that seems unfortunate as I've found clj-kondo to be especially helpful in pointing out and localizing the sorts of common syntax errors that beginners tend to make (eg. extra/missing parens, calling numbers as functions) - also the sort of thing which tend to produce confusing error messages when evaluated in the REPL. Really appreciate all the effort you've put into making the beginner experience as friendly and frictionless as possible, this seems like an area where some relatively simple fix would have a large impact :) After all one clj-kondo can be used as a purely standalone CLI tool that takes stdin with no concept of project folders or files, even though that might not expose 100% of its more advanced linting features.
To make the tutorial more complete it would be nice if it helped with showing a basic project structure. Then it could be a basis for someone’s first project. If we solve this, linting will be enabled out of the box.
I found a workaround for now by installing the standalone clj-kondo
extension ✨
However Calva doesn't seem to like it and keeps displaying a popup warning of "duplicate linting reports".
I do think the "one-click" nature of the standalone REPLs is great for beginners who are just starting out learning the language concepts and syntax and don't need the additional cognitive load of learning about build tools and project folder structure. Enforcing a "create your first project" workflow from the very start just to get squiggly error lines seems like a step backwards, especially as the standalone extension shows it can be done without one
https://github.com/clj-kondo/clj-kondo.lsp
is implemented as its own LSP server after all, perhaps Calva can use it as a fallback when the full clojure-lsp
is not available? (not entirely familiar how this stuff works under the hood)
I've upgraded to the latest Calva version and the autoformatter is doing weird stuff to my indentation, like changing
(fn [a b]
(+ a b))
to
(fn [a b]
(+ a b))
Any ideas what's wrong? This is driving me a bit crazy 🙂. Running v2.0.412
Ah, searched in this channel and found the answer. For anyone having a similar problem: there was a breaking change in a recent version, and if your project has a .cljfmt.edn
file, change indents
-> extra-indents
.
https://calva.io/formatting/#indentation-rules
You must have been on a fairly old version? It feels like that changed "ages ago" (although I can't remember when)...
(looks like mid-August 2023 when it changed... feels longer ago than that... time is an illusion! 🙂 )
I recall it quite well as I was pretty stressed up by the incident and it took me a while to figure out what to do about it. 😀
Yeah, I was running the old version for a while...I recall I rolled it back because something broke when it upgraded (probably this) and I didn't want to deal with figuring it out right then. I was finally prompted to re-upgrade yesterday due to unrelated issues