This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-02
Channels
- # announcements (34)
- # babashka (19)
- # beginners (106)
- # calva (50)
- # cider (25)
- # clj-commons (39)
- # clj-kondo (16)
- # clojure (59)
- # clojure-czech (3)
- # clojure-europe (33)
- # clojure-norway (9)
- # clojure-seattle (1)
- # clojure-sweden (1)
- # clojure-uk (2)
- # clojured (28)
- # clojuredesign-podcast (1)
- # clojurescript (7)
- # code-reviews (19)
- # conjure (15)
- # cursive (3)
- # datomic (3)
- # emacs (21)
- # etaoin (28)
- # graphql (4)
- # introduce-yourself (1)
- # joyride (2)
- # kaocha (2)
- # london-clojurians (8)
- # lsp (24)
- # music (4)
- # nbb (4)
- # nextjournal (1)
- # off-topic (13)
- # other-languages (16)
- # remote-jobs (1)
- # rewrite-clj (6)
- # sci (1)
- # shadow-cljs (40)
- # tools-deps (15)
I migrated neil
to babashka.cli
- anyone care to review? - MERGED
https://github.com/babashka/neil/pull/42/files#diff-2ae0730564e9ad801e95ccf25c3e13122e37e34d9f5f94f7996ebfd53825a22b
A suggestion on how to use babashka.cli
with babashka tasks:
https://github.com/babashka/cli#usage-in-babashka-tasks
Are there any babashka scripts/prior-art of finding all usages of vars from a certain namespace? I’d like to profile json libraries and would love to see the entirety of the cheshire api we use. Would be great to run some kind of bb <something> cheshire.core src:shared/src
or similar and it would report all var usages. Does something like this exist already? Or do i need to just look at clj-kondo analysis?
$ clj
Clojure 1.11.0-alpha4
user=> (require '[clj-kondo.core :as clj-kondo])
nil
user=> (def usages (-> (clj-kondo/run! {:lint ["src"] :config {:analysis true}}) :analysis :var-usages))
#'user/usages
user=> (count (filter #(= 'cheshire.core (:to %)) usages))
1
({:end-row 52, :name-end-col 41, :name-end-row 47, :name-row 47, :name generate-string, :filename "src/clj_kondo/core.clj", :alias cheshire, :from clj-kondo.core, :col 16, :name-col 17, :from-var print!, :end-col 47, :arity 1, :row 47, :to cheshire.core})
{cheshire.core/parse-stream 1,
cheshire.generate/encode-str 1,
cheshire.factory/default-date-format 1,
cheshire.core/encode 3,
cheshire.core/generate-stream 6,
cheshire.generate/encode-map 8,
cheshire.core/generate-string 29,
cheshire.core/parse-string 31,
cheshire.core/decode 1,
cheshire.generate/write-string 1,
cheshire.generate/add-encoder 13,
cheshire.generate/*date-format* 1}
thank you so much @U04V15CAJGot nerd-sniped hard with this @U04V15CAJ. Just wrote the fn-usage-constraint test I've always wanted to write!
(only one d/transact
in the main code)
How do i find the pid of the current bb?
My current method is spawning bash -c 'ps -o ppid= $$'
but not very portable
Cool, thanks @U04V15CAJ
I need to write a script which can either
• make a number of file system changes
or
• with a command line switch report what file system changes it would perform, as in rsync --dry-run
I can imagine building a vector of encoded changes and processing them according to the cli switch, but I thought there might be prior art out there to build on. Any suggestions?