clj-kondo

https://github.com/clj-kondo/clj-kondo
Ory Band 2021-05-03T17:38:39.391Z

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-privateshttps://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

borkdude 2021-05-03T18:22:22.391900Z

@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?

Ory Band 2021-05-03T18:24:18.393500Z

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)

borkdude 2021-05-03T18:28:50.394700Z

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

borkdude 2021-05-03T18:29:18.395100Z

the other option is to write a custom hook to make clj-kondo understand midje

borkdude 2021-05-03T18:30:07.395700Z

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

borkdude 2021-05-03T18:30:47.396500Z

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

Ory Band 2021-05-03T18:33:22.397Z

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

borkdude 2021-05-03T18:33:47.397200Z

not currently

Ory Band 2021-05-03T18:34:05.397400Z

ok. thank you

borkdude 2021-05-03T18:34:15.397800Z

you can disable it completely based on the filename though

Ory Band 2021-05-03T18:35:24.398200Z

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

borkdude 2021-05-03T18:35:47.398400Z

no, it works on a regex

Ory Band 2021-05-03T18:35:59.398700Z

isnt that what i'm looking for?

borkdude 2021-05-03T18:36:22.399300Z

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

Ory Band 2021-05-03T18:36:41.399700Z

ah you meant disable clj-kondo completley? i thought just specific linters

borkdude 2021-05-03T18:37:18.400600Z

that isn't currently possible, it's only possible in the namespace metadata for one specific namespace at a time

Ory Band 2021-05-03T18:37:25.400800Z

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

Ory Band 2021-05-03T18:37:34.401Z

ok, thanks

Ory Band 2021-05-03T18:37:37.401200Z

got ya

2021-05-03T20:00:03.402300Z

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

2021-05-03T20:03:47.402400Z

Context: when writing annotations for multiple functions operating on the same (complex) map, it would be great to reference the map/spec by name.

borkdude 2021-05-03T20:11:37.403200Z

@wallberg no, these keywords currently only refer to a set of predefined types

2021-05-03T20:13:57.403500Z

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