kibit icon indicating copy to clipboard operation
kibit copied to clipboard

Can kibit ignore some part of the code that are false positive?

Open didibus opened this issue 9 years ago • 3 comments
trafficstars

The readme says:

Kibit reads source code without any macro expansion or evaluation. A macro can therefore easily invalidate a rule. Also, kibit will not know if the symbol + in the form (+ x 1) actually refers to a local or to a function in a namespace other than clojure.core. Expect some false positives.

Which I have some false positive in my code caused by macros.

My issue is, I have my builds setup to fail if kibit fails. Is there a way I can put exceptions in place so kibit skips a file, or a function, etc. ?

didibus avatar Jan 09 '16 08:01 didibus

Currently, you can pass files and directories directly to Kibit to process. So you could manually specify the files in your CI script.

Future ideas could be to have ^:kibit-ignore metadata that can go on namespaces and functions. I'm not sure if that is actually a good idea though, I'll need to find out if the community wants to encourage a proliferation of metadata tags.

danielcompton avatar Jan 10 '16 20:01 danielcompton

I personally don't like the idea of having kibit related metadata on my code. I like the way eastwood does it, where it takes an options map which is resolved in multiple ways and merges the maps together. With one of the options simply being :exclude-namespaces [namespace1 namespace2]. And I could see having an :exclude-functions [fully-qualified/my-fn1 fully-qualified/my-fn2]. I don't know if it's possible to do the same in kibit.

didibus avatar Jan 11 '16 17:01 didibus

Hi @danielcompton!

This feature seems to be covered by #159. It would be great if any collaborator of this project will finally approve it.

Cheers, Mark

marksto avatar Sep 13 '21 16:09 marksto