This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-03
Channels
- # aws (6)
- # babashka (77)
- # beginners (102)
- # clj-kondo (24)
- # cljsrn (17)
- # clojure (40)
- # clojure-australia (15)
- # clojure-europe (50)
- # clojure-nl (4)
- # clojure-uk (4)
- # clojurescript (9)
- # conjure (2)
- # cursive (28)
- # data-science (1)
- # datomic (21)
- # events (5)
- # joker (15)
- # malli (136)
- # meander (1)
- # off-topic (25)
- # pathom (4)
- # podcasts-discuss (2)
- # portal (12)
- # portkey (1)
- # powderkeg (1)
- # practicalli (5)
- # re-frame (14)
- # reitit (3)
- # shadow-cljs (49)
- # specter (4)
- # tools-deps (4)
- # unrepl (1)
Hi. I have some things in midje i'd like clj-kondo to stop notifying me about:
• midje's tabular tests: specifically the table column headers such as ?this
and ?that
(the string after the question mark is generic). any idea how can i do that? https://github.com/marick/Midje/wiki/Tabular-facts
• referring and calling private fns using testable-privates
https://github.com/marick/Midje/wiki/Private-functions AND https://github.com/marick/Midje/wiki/Using-private-functions-in-prerequisites
any idea what i should put in clj-kondo config.edn to solve these? thank you
@ory.band Have you already read: - https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md - https://github.com/clj-kondo/clj-kondo/blob/master/doc/linters.md Have you already tried something?
Yes. The thing is, these scenario are kinda unique:
• i haven't found a way to solve the tabular issue. it's an unresolved symbol. i would like unresolved symbol errors, just ignore ones starting with ?xxx
and only for unit test files
• for private calls, i'd like to silence the warning but only for unit test files whose filenames are t_my_test_file.clj
(has a t_
prefix)
you can use namespace local config to disable a linter in a namespace, or you can use local config like #_{:clj-kondo/ignore [:private-call]}
to ignore things locally
https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md once you have a hook that works, you can submit it to https://github.com/clj-kondo/config so other can profit from it too
thanks! good ideas. is there no way to configure clj-kondo for specific namespaces starting with t-
or filenames starting with t_
?
that isn't currently possible, it's only possible in the namespace metadata for one specific namespace at a time
that would do for the private call notification. but for tabular i agree i'll prolly have to write some custom linter/hook
Is there a way to register custom specs which can be referenced in the :type-mismatch
linter?
Example:
{:level :error
:namespaces {foo {bar {:arities {1 {:args [:custom-spec-label-here]}}}}}}
Context: when writing annotations for multiple functions operating on the same (complex) map, it would be great to reference the map/spec by name.
That explains why I didn't find it in the documentation. Thanks for the swift reply and a great tool!