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
the other option is to write a custom hook to make clj-kondo understand midje
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
to suppress private call warnings you could also use #'foo/bar
instead of foo/bar
thanks! good ideas. is there no way to configure clj-kondo for specific namespaces starting with t-
or filenames starting with t_
?
not currently
ok. thank you
you can disable it completely based on the filename though
yeah but you have to provide exact "fully qualified" full file names right?
no, it works on a regex
isnt that what i'm looking for?
I don't think so since you said you still want linting except for some things
ah you meant disable clj-kondo completley? i thought just specific linters
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
ok, thanks
got ya
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.
@wallberg no, these keywords currently only refer to a set of predefined types
That explains why I didn't find it in the documentation. Thanks for the swift reply and a great tool!