This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-06
Channels
- # aleph (70)
- # announcements (9)
- # babashka (43)
- # babashka-sci-dev (6)
- # beginners (97)
- # cider (2)
- # clj-commons (3)
- # clj-kondo (41)
- # clojure (88)
- # clojure-europe (44)
- # clojure-nl (2)
- # clojure-spec (22)
- # clojurescript (65)
- # community-development (6)
- # conjure (10)
- # cursive (6)
- # datahike (13)
- # datomic (4)
- # eastwood (11)
- # events (1)
- # fulcro (45)
- # graalvm (1)
- # graphql (3)
- # hyperfiddle (3)
- # integrant (7)
- # jobs (1)
- # lambdaisland (1)
- # lsp (58)
- # nbb (4)
- # nrepl (3)
- # pathom (15)
- # shadow-cljs (27)
- # tools-deps (1)
Not sure if this is the right place to post this. When the (ns..)
section is folded *and* has some requires
, the "thing" that adds the correct import messes up the parens of the ns
and doesn't add the require. I made short video first showing it working then having it break.
That looks like an lsp client issue to me, either the fold is affecting the text we're being sent or the edit we send back is being applied incorrectly.
in case it's something that needs resolving:
==> Upgrading 1 outdated package:
clojure-lsp/brew/clojure-lsp-native 2022.09.01-15.27.31 -> 2022.10.05-16.39.51
==> Downloading
==> Downloading from
######################################################################## 100.0%
Warning: Cannot verify integrity of '0a2554cd99bc4245ad97e5866120c786db0de2dc912f176718fc712d29807ae1--clojure-lsp-native-macos-aarch64.zip'.
No checksum was provided for this resource.
For your reference, the checksum is:
sha256 "b5b671d58c21364f1b381c6f5524e6551b8b66ee3324e8b1274545db5ed96f23"
I've had this with clj-kondo too. The issue is that if the brew recipe is updated and CI does another release for the same version, the hash of the asset changes... One solution is to run the brew recipe generation again. cc @UKFSJSM38 @U0BUV7XSA @U07M2C8TT
Yeah, I was aware of that, that we were losing the Sha every release, just not sure how to fix the root cause
@UKFSJSM38 I now added an option :overwrite false
- do you want a PR for this?
https://github.com/borkdude/gh-release-artifact/commit/add371333253c0c5e87b519bf66e9b1a25160ec5#diff-eb41a1921d745b990c01a7638b50e4689d163bc9b317cc58c60783d4995c5b2aR226
So:
(ghr/overwrite-asset {:org "clj-kondo"
:repo "clj-kondo"
:file file
:tag (str "v" current-version)
:overwrite (str/ends-with? current-version "SNAPSHOT")})
I now also added a :sha256 true
option which uploads .sha256
files like here:
https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-22.2.0
I'm using it like this in bb now: https://github.com/babashka/babashka/commit/2dac7847a89dde8b09755076a556a14e066ca11d
@UKFSJSM38 What is the condition on which gh-release-artifact should overwrite an already uploaded file of an existing release?
the nightly is a GH action called nightly.yml which just does a date
and append -nightly so yeah, it should have no conflicts AFAIK
o wait... there isn't a SHA at all here? that is weird: https://github.com/clojure-lsp/homebrew-brew/blob/4071932befe456812f624ddde4bb03f6039d6c1a/clojure-lsp-native.rb#L9
Tested and works now. cc @U0509NKGK
nice work!
Is it possible to use zprint when formatting instead of clj-format?
I don't think clojure-lsp has this, but why do you prefer zprint over cljfmt? I'd like to learn about the differences. (Meanwhile, I'm still using clojure-mode)
TMK zprint has more powerful configuration options and extensive docs. Having said this, I haven't used cljfmt in years.
I would keep an eye on compilation time and binary size. Some libs with dynamic requires can blow that up
https://github.com/greglook/cljstyle was interesting to me, since it seemed to expand on cljfmt
+1 for zprint from me too! Very flexible and much more configurable. Too much configurable at times, but also has sane defaults like using the community style guide etc.
Haven’t used it via lsp yet, mostly via neovim’s buffer formatting. But nvim 0.8 has native lsp formatting support so would be great! 😄
I use https://github.com/greglook/cljstyle on the command line (it's available as a binary) and included in setup-clojure GitHub Action. Cljstyle was fairly easy to set up with the https://github.com/practicalli/dotfiles/blob/main/.cljstyle, so very small learning curve. I've added zprint as a aliases to https://github.com/practicalli/clojure-deps-edn, although haven't read up enough about zprint to know how to use it, seems quite different in approach (probably just need to spend time reading the docs)
zprint aims to handle adding and removing newlines, which I believe cljfmt/cljstyle does not. It tries to handle produce the same output for a given input regardless of how the input is currently formatted. It’s significantly more powerful and customizable and it’s worked well at Crossbeam (where I work), but it can produce some really odd formatting lol. I go back and forth whether I like it or don’t.
Yes, cljfmt and cljstyle both remove (and add) lines according to the rules set. I found cljfmt a bit draconian by default, ensuring there was only one line between top-level forms. A little to restrictive for me, especially with LSP auto formatting, I quickly modified that rule to a nice 2 line gap, which feels much nicer to work with to me. Zprint seems very powerful indeed and with great power comes a longer time needed to read the docs. Would like to learn more about zprint when I get the time or find a nice blog that specifically covers lining of a Clojure code base. I got the impression from the docs that there are many more uses that zprint can support though.
Yeah, I think we should consider supporting zprint as long term but we can't drop cljfmt because of breaking changes, feel free to create a issue so we can discuss more about it @U6GNVEWQG
https://github.com/clojure-lsp/clojure-lsp/issues/1315 - let me know if you want me to add any additional information 🙂