How can I modify my pylintrc so that a given decorator is interpreted as a classmethod.
pydantic
defines a validator
decorator to allow for attribute validation of model classes and operates as a class method. pylint
throws a
E0213: Method 'has_risk_assigned' should have "self" as first argument (no-self-argument)
for a validator method declared as:
from pydantic import BaseModel, validator
class RiskyRecord(BaseModel):
# ... attributes ...
@validator('risk')
def has_risk_assigned(cls, v):
# ... make sure that risk is properly assigned ...
How can I configure my pylintrc such that it views this decorator as defining a class (instead of instance) method?
Note: I want a solution in terms of pylintrc since there are multiple classes in this module that each use multiple validators; managing this warning in one place is more desirable.
I only see two classmethod related features in my current pylintrc; both only relate to the valid name(s) for the first argument.