Skip to content

Commit 49af712

Browse files
committed
Add work_not_properly_function_names to per module config
1 parent 5fbedff commit 49af712

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [Unreleased]
44
### Added
55
- Any parameter `_` will be inferred as `object` (#687)
6+
- `work_not_properly_function_names` made available to per module configuration (#699)
67

78
## [2.5.0]
89
### Added

mypy/options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class BuildType:
6060
"warn_return_any",
6161
"warn_unreachable",
6262
"warn_unused_ignores",
63+
"work_not_properly_function_names",
6364
}
6465

6566
OPTIONS_AFFECTING_CACHE: Final = (

test-data/unit/check-based-misc.test

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,29 @@ for _ in [1]:
209209
while True:
210210
if True: # E: Condition is always true [redundant-expr]
211211
reveal_type(1) # N: Revealed type is "1"
212+
213+
214+
[case testWorkNotProperlyFunctionNamesModule]
215+
# flags: --config-file tmp/pyproject.toml
216+
import other
217+
218+
class A:
219+
def f(self, a: int): ...
220+
class B(A):
221+
def f(self, b: int): ... # E: Signature of "f" incompatible with supertype "A" [override] \
222+
# N: Superclass: \
223+
# N: def f(self, a: int) -> None \
224+
# N: Subclass: \
225+
# N: def f(self, b: int) -> None \
226+
# E: Method "f" is not using @override but is overriding a method in class "__main__.A" [explicit-override]
227+
228+
[file other.py]
229+
class A:
230+
def f(self, a: int): ...
231+
class B(A):
232+
def f(self, b: int): ... # E: Method "f" is not using @override but is overriding a method in class "other.A" [explicit-override]
233+
234+
[file pyproject.toml]
235+
\[[tool.mypy.overrides]]
236+
module="other"
237+
work_not_properly_function_names=true

0 commit comments

Comments
 (0)