Skip to content

N815: Regression of classmethod-decorators in v0.0.244 #2673

@ngnpope

Description

@ngnpope

For this code:

import pydantic

class Thing(pydantic.BaseModel):
    @pydantic.root_validator(pre=True)
    def _validate_something(cls, values):
        return values

And this configuration:

[pep8-naming]
classmethod-decorators = ["classmethod", "pydantic.root_validator"]

I get this output:

pipx inject ruff ruff==0.0.243
  injected package ruff into venv ruff
done! ✨ 🌟 ✨ruff --version
ruff 0.0.243ruff --config bug.toml --select N805 bug.py pipx inject ruff ruff==0.0.244
  injected package ruff into venv ruff
done! ✨ 🌟 ✨ruff --version
ruff 0.0.244ruff --config bug.toml --select N805 bug.py 
bug.py:5:29: N805 First argument of a method should be named `self`
Found 1 error.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions