@@ -471,13 +471,18 @@ def process_options(
471471 fscache : FileSystemCache | None = None ,
472472 program : str = "mypy" ,
473473 header : str = HEADER ,
474- ) -> tuple [list [BuildSource ], Options , list [str ]]:
474+ list_to_fill_with_strict_flags : list [str ] | None = None
475+ ) -> tuple [list [BuildSource ], Options ]:
475476 """Parse command line arguments.
476477
477478 If a FileSystemCache is passed in, and package_root options are given,
478479 call fscache.set_package_root() to set the cache's package root.
479480
480- Returns a tuple of: a list of source file, an Options collected from flags, and the computed list of strict flags.
481+ Returns a tuple of: a list of source files, an Options collected from flags.
482+
483+ If list_to_fill_with_strict_flags is provided and not none,
484+ then that list will be extended with the computed list of flags that --strict enables
485+ (as a sort of secret return option).
481486 """
482487 stdout = stdout or sys .stdout
483488 stderr = stderr or sys .stderr
@@ -1515,7 +1520,9 @@ def set_strict_flags() -> None:
15151520 # exceptions of different types.
15161521 except InvalidSourceList as e2 :
15171522 fail (str (e2 ), stderr , options )
1518- return targets , options , strict_flag_names
1523+ if list_to_fill_with_strict_flags is not None :
1524+ list_to_fill_with_strict_flags .extend (strict_flag_names )
1525+ return targets , options
15191526
15201527
15211528def process_package_roots (
0 commit comments