Fork me on GitHub
Ory Band17:05:39

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? • referring and calling private fns using testable-privates AND any idea what i should put in clj-kondo config.edn to solve these? thank you

Ory Band18:05:18

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

borkdude18:05:07 once you have a hook that works, you can submit it to so other can profit from it too


to suppress private call warnings you could also use #'foo/bar instead of foo/bar

Ory Band18:05:22

thanks! good ideas. is there no way to configure clj-kondo for specific namespaces starting with t- or filenames starting with t_ ?


not currently

Ory Band18:05:05

ok. thank you


you can disable it completely based on the filename though

Ory Band18:05:24

yeah but you have to provide exact "fully qualified" full file names right?


no, it works on a regex

Ory Band18:05:59

isnt that what i'm looking for?


I don't think so since you said you still want linting except for some things

Ory Band18:05:41

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

Ory Band18:05:25

that would do for the private call notification. but for tabular i agree i'll prolly have to write some custom linter/hook

Fredrik Wallberg20:05:03

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]}}}}}}

Fredrik Wallberg20:05:47

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

Fredrik Wallberg20:05:57

That explains why I didn't find it in the documentation. Thanks for the swift reply and a great tool!