---
source: crates/ruff_linter/src/rules/pep8_naming/mod.rs
---
N805 [*] First argument of a method should be named `self`
 --> N805.py:7:20
  |
6 | class Class:
7 |     def badAllowed(this):
  |                    ^^^^
8 |         pass
  |
help: Rename `this` to `self`
  |
6 | class Class:
  -     def badAllowed(this):
7 +     def badAllowed(self):
8 |         pass
  |
note: This is an unsafe fix and may change runtime behavior

N805 [*] First argument of a method should be named `self`
  --> N805.py:10:18
   |
 8 |         pass
 9 |
10 |     def stillBad(this):
   |                  ^^^^
11 |         pass
   |
help: Rename `this` to `self`
   |
9  |
   -     def stillBad(this):
10 +     def stillBad(self):
11 |         pass
   |
note: This is an unsafe fix and may change runtime behavior

N805 [*] First argument of a method should be named `self`
  --> N805.py:15:24
   |
13 |     if False:
14 |
15 |         def badAllowed(this):
   |                        ^^^^
16 |             pass
   |
help: Rename `this` to `self`
   |
14 |
   -         def badAllowed(this):
15 +         def badAllowed(self):
16 |             pass
   |
note: This is an unsafe fix and may change runtime behavior

N805 [*] First argument of a method should be named `self`
  --> N805.py:18:22
   |
16 |             pass
17 |
18 |         def stillBad(this):
   |                      ^^^^
19 |             pass
   |
help: Rename `this` to `self`
   |
17 |
   -         def stillBad(this):
18 +         def stillBad(self):
19 |             pass
   |
note: This is an unsafe fix and may change runtime behavior

N805 [*] First argument of a method should be named `self`
  --> N805.py:22:20
   |
21 |     @pydantic.validator
22 |     def badAllowed(cls, my_field: str) -> str:
   |                    ^^^
23 |         pass
   |
help: Rename `cls` to `self`
   |
21 |     @pydantic.validator
   -     def badAllowed(cls, my_field: str) -> str:
22 +     def badAllowed(self, my_field: str) -> str:
23 |         pass
   |
note: This is an unsafe fix and may change runtime behavior

N805 [*] First argument of a method should be named `self`
  --> N805.py:26:18
   |
25 |     @pydantic.validator
26 |     def stillBad(cls, my_field: str) -> str:
   |                  ^^^
27 |         pass
   |
help: Rename `cls` to `self`
   |
25 |     @pydantic.validator
   -     def stillBad(cls, my_field: str) -> str:
26 +     def stillBad(self, my_field: str) -> str:
27 |         pass
   |
note: This is an unsafe fix and may change runtime behavior

N805 [*] First argument of a method should be named `self`
  --> N805.py:30:20
   |
29 |     @pydantic.validator("my_field")
30 |     def badAllowed(cls, my_field: str) -> str:
   |                    ^^^
31 |         pass
   |
help: Rename `cls` to `self`
   |
29 |     @pydantic.validator("my_field")
   -     def badAllowed(cls, my_field: str) -> str:
30 +     def badAllowed(self, my_field: str) -> str:
31 |         pass
   |
note: This is an unsafe fix and may change runtime behavior

N805 [*] First argument of a method should be named `self`
  --> N805.py:34:18
   |
33 |     @pydantic.validator("my_field")
34 |     def stillBad(cls, my_field: str) -> str:
   |                  ^^^
35 |         pass
   |
help: Rename `cls` to `self`
   |
33 |     @pydantic.validator("my_field")
   -     def stillBad(cls, my_field: str) -> str:
34 +     def stillBad(self, my_field: str) -> str:
35 |         pass
   |
note: This is an unsafe fix and may change runtime behavior

N805 First argument of a method should be named `self`
  --> N805.py:55:20
   |
54 | class PosOnlyClass:
55 |     def badAllowed(this, blah, /, self, something: str):
   |                    ^^^^
56 |         pass
   |
help: Rename `this` to `self`

N805 First argument of a method should be named `self`
  --> N805.py:58:18
   |
56 |         pass
57 |
58 |     def stillBad(this, blah, /, self, something: str):
   |                  ^^^^
59 |         pass
   |
help: Rename `this` to `self`
