vulture
vulture copied to clipboard
ignore click functions
Would a feature be welcome to detect and ignore click methods?
I already have them all grouped in a cli/
sub-dir which I can --exclude
,
but it would be nice if Vulture could figure it out 😁
I think it'll require more than just adding to whitelists/
since the names are arbitrary, but...
Since click uses a decorator which makes the functions an instance of click.Command
, I think it could be as easy as:
@cli.command()
def sync():
click.echo('Syncing')
def unused():
print('I am unused)
from click import Command
isinstance(sync, Command)
# True
isinstance(unused, Command)
# False
... and in a find_spec
check to see if the click
is available.