From fdf5bc21f05ff874243c3b120e6682d68dddbf6d Mon Sep 17 00:00:00 2001 From: Marwan Abbas <67271180+marwaneltoukhy@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:02:22 +0530 Subject: [PATCH] Update mpw_precheck.py --- mpw_precheck.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mpw_precheck.py b/mpw_precheck.py index 3322460..51158fa 100755 --- a/mpw_precheck.py +++ b/mpw_precheck.py @@ -109,6 +109,7 @@ def main(*args, **kwargs): parser.add_argument('-o', '--output_directory', required=False, help="OUTPUT_DIRECTORY, default=/precheck_results/DD_MMM_YYYY___HH_MM_SS.") parser.add_argument('--private', action='store_true', help=f"If provided, precheck skips {open_source_checks.keys() - private_checks.keys()} checks that qualify the project to be Open Source") parser.add_argument('checks', metavar='check', type=str, nargs='*', choices=list(open_source_checks.keys()).append([]), help=f"Checks to be run by the precheck: {' '.join(open_source_checks.keys())}") + parser.add_argument('--skip_checks', metavar='check', type=str, nargs='*', choices=list(open_source_checks.keys()).append([]), help=f"Checks not to be run by the precheck: {' '.join(open_source_checks.keys())}") args = parser.parse_args() # NOTE Separated to allow the option later on for a run tag @@ -129,7 +130,12 @@ def main(*args, **kwargs): logging.critical("`GOLDEN_CARAVEL` environment variable is not set. Please set it to point to absolute path to the golden caravel") sys.exit(1) - sequence = args.checks if args.checks else [x for x in private_checks.keys()] if args.private else [x for x in open_source_checks.keys()] + all_checks = list(private_checks.keys()) if args.private else list(open_source_checks.keys()) + sequence = args.checks if args.checks else all_checks + + # Remove skip_checks from sequence + if args.skip_checks: + sequence = [check for check in sequence if check not in args.skip_checks] main(input_directory=args.input_directory, output_directory=output_directory,