hello, is there a way to make clj-kondo ignore a namespace in the project?
my issue is because I'm using the potemkin library to implement a custom map structure: https://github.com/ztellman/potemkin#def-map-type
unless there is a easy way to get that macro understood, I would rather just ignore that namespace
You can try {:lint-as {potemkin/weird-macro clj-kondo.lint-as/def-catch-all}
or lint as clojure.core/deftype
def-catch-all
worked nicely, thanks! 😄
This also seems to work:
(ns foo
{:clj-kondo/config '{:lint-as {foo.bar/def-map-type clojure.core/deftype}}}
(:require [foo.bar :refer [def-map-type]]))
(def-map-type LazyMap [m mta]
(get [_ k default-value]
(if (contains? m k)
(let [v (get m k)]
(if (instance? clojure.lang.Delay v)
@v
v))
default-value))
(assoc [_ k v]
(LazyMap. (assoc m k v) mta))
(dissoc [_ k]
(LazyMap. (dissoc m k) mta))
(keys [_]
(keys m))
(meta [_]
mta)
(with-meta [_ mta]
(LazyMap. m mta)))
You will then even get help with:
(->LazyMap 1)
which will show an arity erroryeah, true, that's better
I would expect that not to work, because the Type is missing before the methods :man-shrugging:
I think clj-kondo doesn't complain about (FooBar.)
since it cannot know if that class exist or not
As for your first question, you can exclude complete files like so: https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#include-and-exclude-files-from-the-output