This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-21
Channels
- # announcements (7)
- # babashka (16)
- # beginners (174)
- # biff (7)
- # calva (20)
- # cider (3)
- # clerk (6)
- # cljsrn (4)
- # clojure (98)
- # clojure-europe (57)
- # clojure-italy (3)
- # clojure-nl (1)
- # clojure-portugal (1)
- # clojure-spec (15)
- # clojure-uk (7)
- # code-reviews (3)
- # cursive (23)
- # data-science (1)
- # datomic (26)
- # dev-tooling (2)
- # emacs (5)
- # figwheel-main (4)
- # fulcro (3)
- # honeysql (20)
- # hyperfiddle (20)
- # malli (8)
- # membrane (31)
- # nextjournal (5)
- # pathom (1)
- # polylith (20)
- # re-frame (14)
- # reitit (8)
- # releases (2)
- # shadow-cljs (50)
- # specter (2)
- # sql (22)
- # xtdb (5)
Is there a way to customize the “Start a standalone repl (not in a project)” command? Use case: In my job I often find myself messing with some messy data (for example right now some json output that I have to format into some readable text). Instead of manually editing the file it would be great to:
• Execute some calva command
• Have it start a new REPL
• With the directory of the file I’m currently editing on the classpath
• And some custom dependencies that I can define somewhere
• Ideally using an alias that defines :main-opts
to start a REPL with reveal
• And create a new .clj
file, maybe even with the (ns)
form prefilled with some of the often used :requires
.
And then I can quickly start messing with the data without having to setup a whole project with deps.edn
etc.
I don’t think that command can be customized (@U0ETXRFEW, correct me if I’m wrong), but it seems you could do all that you can do just about everything in that list by just using a test/workshop project that you can open any time you want to manipulate some data from a file. The only caveat as that you’ll need to make sure the file is on the classpath, but this could be a really quick, standardized process.
Sounds interesting. Maybe it is something you can automate using #C03DPCLCV9N + niel or deps-new. At least to some extent.
I haven’t looked into joyride yet, I will investigate when I have the time. But @U9A1RLFNV is also right of course: having a “scratch” project could also help.
Dear Calva friends: v2.0.333 just released. Thanks @m401 for smoothing out the rough edges we created with the multi-clojure-lsp update! 🙏 ❤️ • Fix: https://github.com/BetterThanTomorrow/calva/issues/2065 • Fix: https://github.com/BetterThanTomorrow/calva/issues/2084 • Fix: https://github.com/BetterThanTomorrow/calva/issues/2069
How do I disable clj-kondo entirely (i.e. not in a project file)
thanks, ok so this is a LSP setting then?
Yes, calva uses clojure-lsp that uses clj-kondo under the hood, you should disable it via clojure-lsp settings
Note that even if you disable lint warnings, you will still benefit from the static analysis clj-kondo performs and that clojure-lsp uses :-)
thanks, ok i am not clear on how the pieces fit together and what capabilities are powered by what
clojure-lsp uses https://github.com/clj-kondo/clj-kondo/tree/master/analysisfeature to understand and provide most features, also, it uses clj-kondo lint to provide the diagnostics feature as well, which can be disabled as you asked
for example when you navigate to the definition of a local in a let expression, this analysis is coming from kondo
What’s the reason you want to disable linting, @U09K620SG ?
i am still trying to learn calva, the electric codebase came up for me with 14k “problems”, not sure what’s going on yet
It seems 13K of the messages are from the scratch
directory. There are many legit messages there, though it's hard to tell the ratio. To silence everything from there you can add this to .lsp/config.edn
:
:source-paths-ignore-regex ["scratch"]
(Not sure if the regex needs to be anchored, but the example in clojure-lsp docs indicates that it doesn't.)
Then we have 1K+ messages still. Many are legit and the right way to deal with them is probably on a case-by-case basis to either fix or configure clj-kondo.
Then we have a lot of cases like this, where clj-kondo flags _
as an unresolved symbol. Guess it is not ready to see it at that side of a binding (Or it get's thrown out of whack by the RCF syntax.) Hopefully @U04V15CAJ can see how this should be handled.
(tests
; careful, calling seq loses metas on the underlying
(def h ( "src/"))
(type h) := java.io.File
"(datafy file) returns an EDN-ready data view that is one layer deep"
(datafy h)
:= #:user.datafy-fs{:name "src",
:absolute-path _,
:size _,
:modified _,
:created _,
:accessed _,
:kind ::dir,
:children _
:parent ...})
I could probably go on, but running out of time here. Let me just mention another category of problems:
(def !moves #?(:clj (atom []) :cljs nil))
(def !board-size #?(:clj (atom 10000) :cljs nil))
(e/def board-size (e/server (e/watch !board-size)))
(comment (do (reset! !moves []) (reset! !board-size 2000)))
Here clj-kondo correctly flags the expected atoms in the :cljs
branch as being nil
. But it is in a comment
so maybe there is a way to relax clj-kondo in those...Thanks, yeah i just haven't had time to figure it out
we also use clojure in uncommon patterns due to the nature of our project that most people might find immoral, but i will figure out the linters, not trying to be controversial 🙂