venantius / yagni

A Leiningen plugin for finding dead code
Eclipse Public License 1.0
219 stars 10 forks source link

functions in spec/def not referenced? #36

Open kurt-o-sys opened 8 years ago

kurt-o-sys commented 8 years ago

Having a function:

(defn- somefunction "cool doc"
  [arg]
  ... do funky stuff ...)

and and a clojure spec:

(spec/def ::speckey (spec/and 
  #(contains? % :specialkey)
  #(somefunction (:specialkey %)))

Yagni gives a WARN: could not find any references to the following:.

venantius commented 8 years ago

Yeah, support for clojure.spec will require some additional patching. These sort of namespace-localized keywords aren't currently part of Yagni's tracing algorithm.