-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix {class,static}method-decorators for dotted names
- Loading branch information
1 parent
565ddeb
commit 335c989
Showing
7 changed files
with
219 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...ep8_naming/snapshots/ruff_linter__rules__pep8_naming__tests__staticmethod_decorators.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pep8_naming/mod.rs | ||
--- | ||
N805.py:7:20: N805 First argument of a method should be named `self` | ||
| | ||
6 | class Class: | ||
7 | def bad_method(this): | ||
| ^^^^ N805 | ||
8 | pass | ||
| | ||
|
||
N805.py:12:30: N805 First argument of a method should be named `self` | ||
| | ||
10 | if False: | ||
11 | | ||
12 | def extra_bad_method(this): | ||
| ^^^^ N805 | ||
13 | pass | ||
| | ||
|
||
N805.py:31:15: N805 First argument of a method should be named `self` | ||
| | ||
30 | @pydantic.validator | ||
31 | def lower(cls, my_field: str) -> str: | ||
| ^^^ N805 | ||
32 | pass | ||
| | ||
|
||
N805.py:35:15: N805 First argument of a method should be named `self` | ||
| | ||
34 | @pydantic.validator("my_field") | ||
35 | def lower(cls, my_field: str) -> str: | ||
| ^^^ N805 | ||
36 | pass | ||
| | ||
|
||
N805.py:64:29: N805 First argument of a method should be named `self` | ||
| | ||
62 | pass | ||
63 | | ||
64 | def bad_method_pos_only(this, blah, /, self, something: str): | ||
| ^^^^ N805 | ||
65 | pass | ||
| | ||
|
||
N805.py:70:13: N805 First argument of a method should be named `self` | ||
| | ||
68 | class ModelClass: | ||
69 | @hybrid_property | ||
70 | def bad(cls): | ||
| ^^^ N805 | ||
71 | pass | ||
| | ||
|
||
N805.py:78:13: N805 First argument of a method should be named `self` | ||
| | ||
77 | @bad.wtf | ||
78 | def bad(cls): | ||
| ^^^ N805 | ||
79 | pass | ||
| | ||
|
||
N805.py:86:14: N805 First argument of a method should be named `self` | ||
| | ||
85 | @good.expression | ||
86 | def good(cls): | ||
| ^^^ N805 | ||
87 | pass | ||
| | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters