Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SvenWarnke opened this issue Feb 22, 2023 · 7 comments
Open

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

SvenWarnke opened this issue Feb 22, 2023 · 7 comments

Comments

@SvenWarnke
Copy link

SvenWarnke commented Feb 22, 2023

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
Copy link

addykan commented Apr 20, 2023

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

@jendrikseipp
Copy link
Owner

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

@addykan
Copy link

addykan commented Apr 26, 2023

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

@jendrikseipp
Copy link
Owner

Here in the comments is fine.

@rb-synth
Copy link

rb-synth commented Oct 9, 2024

no progress on this I guess?

@jc-louis
Copy link

jc-louis commented Oct 9, 2024

I only want to see unused function or class (not variables, too many false positive), I'm using:

! vulture . | grep -e 'unused function' -e 'unused class'

@rb-synth
Copy link

rb-synth commented Oct 9, 2024

hm, and something that works as a pre-commit hook?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants