@@ -97,7 +97,7 @@ def type_check_only(sources: List[BuildSource], bin_dir: str, options: Options)
9797 options = options )
9898
9999
100- disallow_any_options = ['unimported' ]
100+ disallow_any_options = ['unimported' , 'unannotated' ]
101101
102102
103103def disallow_any_argument_type (raw_options : str ) -> List [str ]:
@@ -201,7 +201,6 @@ def process_options(args: List[str],
201201
202202 strict_flag_names = [] # type: List[str]
203203 strict_flag_assignments = [] # type: List[Tuple[str, bool]]
204- disallow_any_options = ['unimported' ]
205204
206205 def add_invertible_flag (flag : str ,
207206 * ,
@@ -428,6 +427,9 @@ def add_invertible_flag(flag: str,
428427 print ("Warning: --no-fast-parser no longer has any effect. The fast parser "
429428 "is now mypy's default and only parser." )
430429
430+ if 'unannotated' in options .disallow_any :
431+ options .disallow_untyped_defs = True
432+
431433 # Check for invalid argument combinations.
432434 if require_targets :
433435 code_methods = sum (bool (c ) for c in [special_opts .modules ,
@@ -725,6 +727,8 @@ def parse_section(prefix: str, template: Options,
725727 except ValueError as err :
726728 print ("%s: %s: %s" % (prefix , key , err ), file = sys .stderr )
727729 continue
730+ if key == 'disallow_any' :
731+ results ['disallow_untyped_defs' ] = v and 'unannotated' in v
728732 if key == 'silent_imports' :
729733 print ("%s: silent_imports has been replaced by "
730734 "ignore_missing_imports=True; follow_imports=skip" % prefix , file = sys .stderr )
0 commit comments