@@ -97,7 +97,7 @@ def type_check_only(sources: List[BuildSource], bin_dir: str, options: Options)
97
97
options = options )
98
98
99
99
100
- disallow_any_options = ['unimported' ]
100
+ disallow_any_options = ['unimported' , 'unannotated' ]
101
101
102
102
103
103
def disallow_any_argument_type (raw_options : str ) -> List [str ]:
@@ -201,7 +201,6 @@ def process_options(args: List[str],
201
201
202
202
strict_flag_names = [] # type: List[str]
203
203
strict_flag_assignments = [] # type: List[Tuple[str, bool]]
204
- disallow_any_options = ['unimported' ]
205
204
206
205
def add_invertible_flag (flag : str ,
207
206
* ,
@@ -428,6 +427,9 @@ def add_invertible_flag(flag: str,
428
427
print ("Warning: --no-fast-parser no longer has any effect. The fast parser "
429
428
"is now mypy's default and only parser." )
430
429
430
+ if 'unannotated' in options .disallow_any :
431
+ options .disallow_untyped_defs = True
432
+
431
433
# Check for invalid argument combinations.
432
434
if require_targets :
433
435
code_methods = sum (bool (c ) for c in [special_opts .modules ,
@@ -725,6 +727,8 @@ def parse_section(prefix: str, template: Options,
725
727
except ValueError as err :
726
728
print ("%s: %s: %s" % (prefix , key , err ), file = sys .stderr )
727
729
continue
730
+ if key == 'disallow_any' :
731
+ results ['disallow_untyped_defs' ] = v and 'unannotated' in v
728
732
if key == 'silent_imports' :
729
733
print ("%s: silent_imports has been replaced by "
730
734
"ignore_missing_imports=True; follow_imports=skip" % prefix , file = sys .stderr )
0 commit comments