Skip to content

Commit 6b99832

Browse files
ddfishergvanrossum
authored andcommitted
Move per-file strict Optional checking to mypy's main config file (#3698)
1 parent 677a6fc commit 6b99832

File tree

3 files changed

+51
-56
lines changed

3 files changed

+51
-56
lines changed

mypy_self_check.ini

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,57 @@
22
disallow_untyped_defs = True
33
disallow_subclassing_any = True
44
warn_no_return = True
5+
strict_optional = True
56

67
; historical exceptions
78
[mypy-mypy.test.testextensions]
89
disallow_untyped_defs = False
10+
11+
; non-strict Optional modules
12+
[mypy-mypy.build]
13+
strict_optional = False
14+
15+
[mypy-mypy.checker]
16+
strict_optional = False
17+
18+
[mypy-mypy.checkexpr]
19+
strict_optional = False
20+
21+
[mypy-mypy.fastparse]
22+
strict_optional = False
23+
24+
[mypy-mypy.fastparse2]
25+
strict_optional = False
26+
27+
[mypy-mypy.main]
28+
strict_optional = False
29+
30+
[mypy-mypy.myunit]
31+
strict_optional = False
32+
33+
[mypy-mypy.semanal]
34+
strict_optional = False
35+
36+
[mypy-mypy.server.astdiff]
37+
strict_optional = False
38+
39+
[mypy-mypy.server.astmerge]
40+
strict_optional = False
41+
42+
[mypy-mypy.server.aststrip]
43+
strict_optional = False
44+
45+
[mypy-mypy.server.update]
46+
strict_optional = False
47+
48+
[mypy-mypy.test.testinfer]
49+
strict_optional = False
50+
51+
[mypy-mypy.test.testmerge]
52+
strict_optional = False
53+
54+
[mypy-mypy.test.testtypes]
55+
strict_optional = False
56+
57+
[mypy-mypy.waiter]
58+
strict_optional = False

mypy_strict_optional.ini

Lines changed: 0 additions & 53 deletions
This file was deleted.

runtests.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ def add_basic(driver: Driver) -> None:
170170

171171

172172
def add_selftypecheck(driver: Driver) -> None:
173-
driver.add_mypy_package('package mypy nonstrict optional', 'mypy', '--config-file',
174-
'mypy_self_check.ini')
175-
driver.add_mypy_package('package mypy', 'mypy', '--config-file', 'mypy_strict_optional.ini')
173+
driver.add_mypy_package('package mypy', 'mypy', '--config-file', 'mypy_self_check.ini')
176174

177175

178176
def find_files(base: str, prefix: str = '', suffix: str = '') -> List[str]:

0 commit comments

Comments
 (0)