This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-12
Channels
- # announcements (4)
- # babashka (7)
- # beginners (55)
- # cider (1)
- # clojure (14)
- # clojure-austin (3)
- # clojure-europe (30)
- # clojure-gamedev (1)
- # clojure-nl (1)
- # clojure-norway (142)
- # clojure-uk (4)
- # clojuredesign-podcast (4)
- # clojurescript (114)
- # conjure (1)
- # cursive (1)
- # data-science (2)
- # gratitude (6)
- # helix (2)
- # hyperfiddle (20)
- # jobs-discuss (6)
- # lsp (21)
- # off-topic (40)
- # pathom (1)
- # practicalli (1)
- # quil (11)
- # rdf (13)
- # re-frame (11)
- # reitit (2)
- # sci (25)
- # shadow-cljs (39)
- # squint (2)
- # tools-deps (73)
Any idea why the following hangs
12:22:25 ~ $ rlwrap bb
Babashka v1.3.179 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.
user=> (do
(require '[babashka.pods :as pods])
(pods/load-pod 'clj-kondo/clj-kondo "2023.04.14")
(require '[pod.borkdude.clj-kondo :as clj-kondo])
(with-in-str "(x )" (clj-kondo/run! {:lint ["-"]}))
)
0% cpu usage. The with-in-str
was taken from https://github.com/clj-kondo/clj-kondo/blob/c0a6b525d89f32a648fa044e78cfc2dcbbaef94d/test/clj_kondo/core_test.clj#L64Ah ok thanks. Yes I had tried with a temporary but wasn’t sure if it was possible to set an explicit filename so as to avoid the ns warning. My understand is that it is only when "-"
is used that the value of :filename
is checked.
Concretely, I have a little babashka script that computes which linting errors have been introduced in any staged and unstaged commits. I then compute which current lines in a file have new linting errors.
Currently I just stash everything and then run clj-kondo before unstashing and linting again before compating results. This is fine, and lets me avoid any temp files.
https://github.com/beoliver/diff-lint/blob/master/diff_lint.clj
However, I occurred to me that the following approach would let me get the linting results “pre changes” and avoid having to git stash
git --no-pager show HEAD:src/some/file.clj | clj-kondo --cache false --filename $(pwd)/src/some/file.clj --lint -
and then run clj-kondo
on some/file.clj
.