jendrikseipp / vulture

Find dead Python code
MIT License
3.45k stars 152 forks source link

How to ignore unused variable attributes of a `Meta` class? #315

Open albertas opened 1 year ago

albertas commented 1 year ago

Its a common practice to use Meta class to set options in frameworks. e.g.:

from marshmallow import Schema, EXCLUDE

class MySchema(Schema):
    class Meta:
        unknown = EXCLUDE

When calling vulture with vulture . --ignore-names=Meta, I get this error message:

example.py:5: unused variable 'unknown' (60% confidence)

I imagine that an option ignore_attrs_of_classes=Meta could be added.