Fork me on GitHub
#clj-kondo
<
2024-01-08
>
Ingy döt Net14:01:43

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 🙂

👍 1
delaguardo15:01:38

you might be interested learning how #p is made available everywhere without explicit require and clj-kondo warnings :) https://github.com/weavejester/hashp

❤️ 1
Ingy döt Net16:01:20

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.

Ingy döt Net16:01:43

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 🙂

borkdude16:01:50

I would just put a #_:clj-kondo/ignore in front of the private usage

borkdude16:01:14

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

borkdude16:01:26

perhaps you can also use a #_:clj-kondo/ignore there

Ingy döt Net16:01:03

trying those out!

Ingy döt Net16:01:16

$ clj-kondo --lint .
linting took 857ms, errors: 0, warnings: 0
Thanks again!!!

🎉 2
Ingy döt Net16:01:18

clj-kondo++ btw 😄

❤️ 1