Permalink
Browse files

Use --flags option to *append* flags on hh_single_type_check

Summary: Currently the `--flags` option on `verify.py` replaces any flags specified for individual files or in the `HH_FLAGS` file. It makes more sense to add additional flags, e.g. when specifying `--new-inference`.

Reviewed By: kmeht

Differential Revision: D13115814

fbshipit-source-id: 9b7fbc79e1781a21ff8d4db0e1e8e7848b4e9fb0
  • Loading branch information...
andrewjkennedy authored and hhvm-bot committed Nov 18, 2018
1 parent 94b6082 commit d514c2da63ca0fe8cd22a48321b3aa8d5b14003e
Showing with 6 additions and 8 deletions.
  1. +6 −8 hphp/hack/test/verify.py
@@ -356,12 +356,11 @@ def get_flags_cache(args_flags: List[str]) -> Callable[[str], List[str]]:
flags_cache: Dict[str, List[str]] = {}
def get_flags(test_dir: str) -> List[str]:
if test_dir not in flags_cache:
flags_cache[test_dir] = get_hh_flags(test_dir)
flags = flags_cache[test_dir]
if args_flags is not None:
flags = args_flags
else:
if test_dir not in flags_cache:
flags_cache[test_dir] = get_hh_flags(test_dir)
flags = flags_cache[test_dir]
flags = flags + args_flags
return flags
return get_flags
@@ -396,11 +395,10 @@ def abspath(path: str) -> str:
help='Pass test input file via stdin')
parser.add_argument('--batch', action='store_true',
help='Run tests in batches to the test program')
parser.epilog = "Unless --flags is passed as an argument, "\
"%s looks for a file named HH_FLAGS in the same directory" \
parser.epilog = "%s looks for a file named HH_FLAGS in the same directory" \
" as the test files it is executing. If found, the " \
"contents will be passed as arguments to " \
"<program>." % parser.prog
"<program> in addition to any arguments specified by --flags" % parser.prog
args = parser.parse_args()
max_workers = args.max_workers

0 comments on commit d514c2d

Please sign in to comment.