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

--ignore-bodies-if-inherits-from doesn't seem to work #18

Open
andreyfedoseev opened this issue Aug 22, 2024 · 0 comments
Open

--ignore-bodies-if-inherits-from doesn't seem to work #18

andreyfedoseev opened this issue Aug 22, 2024 · 0 comments

Comments

@andreyfedoseev
Copy link

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.

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

1 participant