github / github/codeql

General issue - `py/not-named-cls` should trigger for implicit class methods

Open
#2,826 0 comments 0 reactions 0 assignees View on GitHub
Python question
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

**Description of the issue**

`py/not-named-cls` should trigger for wrong first arg name for special method names that implicitly make the methods class methods.
For example:
```py
class Example:
def __init_subclass__(self): # should error and say to use `cls` instead
pass

def __class_getitem__(self): # should error and say to use `cls` instead
pass
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.