astral-sh / astral-sh/ruff

(🎁) should `N804` enforce `mcs` on metaclass `classmethod`s?

Open
#13,698 4 comments 3 reactions 0 assignees View on GitHub
needs-decision rule
Dominant language
Rust
Stars
49.6k
Forks
2.4k
Avg merge
2d 1h
Merged PRs (30d)
458

Description

```py
class M(type):
def f(self): # N804
pass
def m(cls): # no error
pass
@classmethod
def m(cls): # no error
pass
@classmethod
def c(mcs): # N804
pass
```
i would expect this to be `N804`, `no error`, `N804`, `no error`

Contributor guide

Open the contributing guide

Research direction

Start at Ruff's N804 rule implementation and use the provided metaclass snippet as the reproduction case. Verify the four method forms, then confirm that diagnostics match the expected N804 and no-error outcomes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.