File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -510,7 +510,7 @@ def parse_section(
510510 "disabled_error_codes" : "disable_error_code" ,
511511 }
512512
513- for key in section :
513+ for key in sorted ( section , key = lambda k : - 1 if k in { "strict" } else 0 ) :
514514 invert = False
515515 options_key = key
516516 if key in config_types :
Original file line number Diff line number Diff line change @@ -2180,6 +2180,29 @@ strict = False
21802180\[mypy-strictmodule]
21812181strict = True
21822182
2183+
2184+ [case testStrictPerModuleOverride]
2185+ # flags: --config-file tmp/mypy.ini
2186+
2187+ import strictmodule
2188+ import strictermodule
2189+
2190+ [file strictmodule.py]
2191+ x: list
2192+ 0 # type: ignore
2193+
2194+ [file strictermodule.py]
2195+ x: list # E: Missing type arguments for generic type "list"
2196+ 0 # type: ignore # E: Unused "type: ignore" comment
2197+
2198+ [file mypy.ini]
2199+ \[mypy]
2200+ disallow_any_generics = false
2201+ strict = true
2202+ warn_unused_ignores = false
2203+ \[mypy-strictermodule]
2204+ strict = true
2205+
21832206[case testNoImplicitOptionalPerModule]
21842207# flags: --config-file tmp/mypy.ini
21852208import m
You can’t perform that action at this time.
0 commit comments