jendrikseipp / vulture

Find dead Python code
MIT License
3.38k stars 148 forks source link

Add argument to filter for unused function, variable or class #303

Open SvenWarnke opened 1 year ago

SvenWarnke commented 1 year ago

As far as I can see there is no way of telling vulture to only search for e.g. dead functions but not dead variables and classes, etc.

If that was added I could cover the following use case: only check for unused global variables (written in CAPITAL_STYLE). The reason is, there seem to be a lot of false positives for dead attribute detection and there are other tools that capture this well (e.g. Syntax highlighting).

Also it could enable me to react differently based on which outcome I get, i.e. warning for unused variables but error on unused function.

addykan commented 1 year ago

Hey! Hoping to work on this and get a fix up in the next few weeks.

jendrikseipp commented 1 year ago

Happy to discuss a high-level strategy for implementing this, if you want to avoid implementation work.

addykan commented 1 year ago

That would be great, actually! How would you like to get in touch?

jendrikseipp commented 1 year ago

Here in the comments is fine.