deadcode
deadcode copied to clipboard
`--ignore-bodies-if-inherits-from` doesn't seem to work
Hello,
I'm trying to use the --ignore-bodies-if-inherits-from option to drop false positives for class attributes in my GraphQL schema, but it doesn't to work.
This is easily reproducible:
# mymodule.py
import graphene
class SomeQuery(graphene.ObjectType):
this_field_is_used = graphene.String()
$ deadcode ./mymodule.py --ignore-bodies-if-inherits-from graphene.ObjectType
mymodule.py:4:0: DC03 Class `SomeQuery` is never used
mymodule.py:6:4: DC01 Variable `this_field_is_used` is never used
$ deadcode ./mymodule.py --ignore-bodies-if-inherits-from ObjectType
mymodule.py:4:0: DC03 Class `SomeQuery` is never used
mymodule.py:6:4: DC01 Variable `this_field_is_used` is never used
I'm using deadcode==2.4.1
P.S. --ignore-definitions-if-inherits-from doesn't work either.