venantius / yagni

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

deftype constructor reported as parent is noise #21

Closed NoamB closed 9 years ago

NoamB commented 9 years ago

Somewhere in the file:

(deftype MyCoolType
...

When running lein yagni:

=================== WARNING: Parents ======================
== Could not find any references to the following vars. ===
===========================================================

my.cool.ns/->MyCoolType
venantius commented 9 years ago

@NoamB - thanks for opening this and the other issues. I'll see if I can't get some time to poke around at them in the coming week. Just wanted to let you know I'm paying attention :)

venantius commented 9 years ago

Is the desired behavior here that instead Yagni should warn for the deftype form name instead of the constructor? E.g. the emitted warning should instead be:

=================== WARNING: Parents ======================
== Could not find any references to the following vars. ===
===========================================================

my.cool.ns/MyCoolType
NoamB commented 9 years ago

Ideally it would check if you use this type with any constructor including Java interop ones like (MyCoolType. ) and (new MyCoolType)

venantius commented 9 years ago

Yep, that sounds reasonable. We'll want to cover constructors from both deftype and defrecord, too.

venantius commented 9 years ago

@NoamB - I've pushed up a new branch - check out #27 or just pull 0.1.2-SNAPSHOT to check it out. I think it should resolve this and #23.