This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-08
Channels
- # beginners (36)
- # calva (13)
- # cider (3)
- # clerk (7)
- # clj-http (2)
- # clj-kondo (10)
- # clojure (20)
- # clojure-europe (14)
- # clojure-nl (1)
- # clojure-norway (26)
- # clojure-uk (5)
- # clojurescript (143)
- # dev-tooling (7)
- # events (1)
- # exercism (1)
- # honeysql (8)
- # hyperfiddle (4)
- # jobs-discuss (15)
- # leiningen (3)
- # lsp (31)
- # off-topic (17)
- # overtone (3)
- # pathom (11)
- # pedestal (11)
- # re-frame (15)
- # reitit (17)
- # releases (1)
- # scittle (2)
- # shadow-cljs (29)
- # squint (1)
- # yamlscript (3)
I just figured out a cool way to disable a clj-kondo warning I get on every ns...
I have a debugging util that I use all the time and it needs this line in my ns
form
[yamlscript.debug :refer [www]]
then I get the warnings:
core/src/yamlscript/runtime.clj:6:5: warning: namespace yamlscript.debug is required but never used
core/src/yamlscript/runtime.clj:6:30: warning: #'yamlscript.debug/www is referred but never used
I also have a rich comment at the bottom of each clj file. so now I just add www
to the comment form:
(comment
www
(eval-string "(say (inc 123))"))
and the warnings go away 🙂you might be interested learning how #p
is made available everywhere without explicit require and clj-kondo warnings :)
https://github.com/weavejester/hashp
Nice. I'll check it out. Thanks!
That's how my www
works (returns the value printed) but extra nice as a reader thing.
www is from here https://metacpan.org/dist/XXX/view/lib/XXX.pod and I've ported to many languages.
I've gotten rid of all the errors and warnings except for these:
$ clj-kondo --lint .
./.cljfmt.edn:1:18: error: Regex literals are not allowed in EDN
./core/src/a0/patch_pprint.clj:36:37: error: #'clojure.pprint/write-option-table is private
./core/src/a0/patch_pprint.clj:48:15: error: #'clojure.pprint/with-pretty-writer is private
linting took 2175ms, errors: 3, warnings: 0
@borkdude the first 2 are from code I copied from you: https://github.com/yaml/yamlscript/blob/main/core/src/a0/patch_pprint.clj#L8
and the cljfmt is from a suggestion I picked up here from someone:
$ cat .cljfmt.edn
{:extra-indents {#"" [[:inner 0]]}}
Help appreciated 🙂as for the regex in edn files: this is true, I think cljfmt shouldn't have used .edn
here since the file cannot be read as EDN if you use regex literals
trying those out!
$ clj-kondo --lint .
linting took 857ms, errors: 0, warnings: 0
Thanks again!!!