-
Notifications
You must be signed in to change notification settings - Fork 932
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use class name as range for
B024
(#4647)
- Loading branch information
1 parent
28a5e60
commit c9b39e3
Showing
3 changed files
with
40 additions
and
31 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
60 changes: 30 additions & 30 deletions
60
.../src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.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 |
---|---|---|
@@ -1,52 +1,52 @@ | ||
--- | ||
source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ||
--- | ||
B024.py:18:1: B024 `Base_1` is an abstract base class, but it has no abstract methods | ||
B024.py:18:7: B024 `Base_1` is an abstract base class, but it has no abstract methods | ||
| | ||
18 | / class Base_1(ABC): # error | ||
19 | | def method(self): | ||
20 | | foo() | ||
| |_____________^ B024 | ||
18 | class Base_1(ABC): # error | ||
| ^^^^^^ B024 | ||
19 | def method(self): | ||
20 | foo() | ||
| | ||
|
||
B024.py:71:1: B024 `MetaBase_1` is an abstract base class, but it has no abstract methods | ||
B024.py:71:7: B024 `MetaBase_1` is an abstract base class, but it has no abstract methods | ||
| | ||
71 | / class MetaBase_1(metaclass=ABCMeta): # error | ||
72 | | def method(self): | ||
73 | | foo() | ||
| |_____________^ B024 | ||
71 | class MetaBase_1(metaclass=ABCMeta): # error | ||
| ^^^^^^^^^^ B024 | ||
72 | def method(self): | ||
73 | foo() | ||
| | ||
|
||
B024.py:82:1: B024 `abc_Base_1` is an abstract base class, but it has no abstract methods | ||
B024.py:82:7: B024 `abc_Base_1` is an abstract base class, but it has no abstract methods | ||
| | ||
82 | / class abc_Base_1(abc.ABC): # error | ||
83 | | def method(self): | ||
84 | | foo() | ||
| |_____________^ B024 | ||
82 | class abc_Base_1(abc.ABC): # error | ||
| ^^^^^^^^^^ B024 | ||
83 | def method(self): | ||
84 | foo() | ||
| | ||
|
||
B024.py:87:1: B024 `abc_Base_2` is an abstract base class, but it has no abstract methods | ||
B024.py:87:7: B024 `abc_Base_2` is an abstract base class, but it has no abstract methods | ||
| | ||
87 | / class abc_Base_2(metaclass=abc.ABCMeta): # error | ||
88 | | def method(self): | ||
89 | | foo() | ||
| |_____________^ B024 | ||
87 | class abc_Base_2(metaclass=abc.ABCMeta): # error | ||
| ^^^^^^^^^^ B024 | ||
88 | def method(self): | ||
89 | foo() | ||
| | ||
|
||
B024.py:92:1: B024 `notabc_Base_1` is an abstract base class, but it has no abstract methods | ||
B024.py:92:7: B024 `notabc_Base_1` is an abstract base class, but it has no abstract methods | ||
| | ||
92 | / class notabc_Base_1(notabc.ABC): # error | ||
93 | | def method(self): | ||
94 | | foo() | ||
| |_____________^ B024 | ||
92 | class notabc_Base_1(notabc.ABC): # error | ||
| ^^^^^^^^^^^^^ B024 | ||
93 | def method(self): | ||
94 | foo() | ||
| | ||
|
||
B024.py:141:1: B024 `abc_set_class_variable_4` is an abstract base class, but it has no abstract methods | ||
B024.py:141:7: B024 `abc_set_class_variable_4` is an abstract base class, but it has no abstract methods | ||
| | ||
141 | # this doesn't actually declare a class variable, it's just an expression | ||
142 | / class abc_set_class_variable_4(ABC): # error | ||
143 | | foo | ||
| |_______^ B024 | ||
141 | # this doesn't actually declare a class variable, it's just an expression | ||
142 | class abc_set_class_variable_4(ABC): # error | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ B024 | ||
143 | foo | ||
| | ||
|
||
|