Skip to content

Commit

Permalink
Update mpw_precheck.py
Browse files Browse the repository at this point in the history
  • Loading branch information
marwaneltoukhy authored Sep 3, 2024
1 parent ea8097a commit fdf5bc2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mpw_precheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def main(*args, **kwargs):
parser.add_argument('-o', '--output_directory', required=False, help="OUTPUT_DIRECTORY, default=<input_directory>/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
Expand All @@ -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,
Expand Down

0 comments on commit fdf5bc2

Please sign in to comment.