From 61e7324e851a0142c47cb9cdd2a4521cb45c8c1d Mon Sep 17 00:00:00 2001 From: Mateusz Masiarz Date: Fri, 5 Apr 2024 12:23:26 +0200 Subject: [PATCH] Add flag for ignoring expected scores --- src/sinol_make/commands/run/__init__.py | 8 ++++++++ src/sinol_make/commands/verify/__init__.py | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/sinol_make/commands/run/__init__.py b/src/sinol_make/commands/run/__init__.py index c8e35a0d..69cc2f5f 100644 --- a/src/sinol_make/commands/run/__init__.py +++ b/src/sinol_make/commands/run/__init__.py @@ -300,6 +300,9 @@ def configure_subparser(self, subparser): help='path to oiejq executable (default: `~/.local/bin/oiejq`)') parser.add_argument('-a', '--apply-suggestions', dest='apply_suggestions', action='store_true', help='apply suggestions from expected scores report') + parser.add_argument('--ignore-expected', dest='ignore_expected', action='store_true', + help='ignore expected scores from config.yml. When this flag is set, ' + 'the expected scores are not compared with the actual scores.') add_compilation_arguments(parser) return parser @@ -1238,6 +1241,11 @@ def run(self, args): results, all_results = self.compile_and_run(solutions) self.check_errors(all_results) + if self.args.ignore_expected: + print(util.warning("Ignoring expected scores.")) + self.exit() + return + try: validation_results = self.validate_expected_scores(results) except Exception: diff --git a/src/sinol_make/commands/verify/__init__.py b/src/sinol_make/commands/verify/__init__.py index cc09b316..f42dbe74 100644 --- a/src/sinol_make/commands/verify/__init__.py +++ b/src/sinol_make/commands/verify/__init__.py @@ -40,6 +40,10 @@ def configure_subparser(self, subparser): help=f'number of cpus that sinol-make will use ' f'(default: {util.default_cpu_count()})', default=util.default_cpu_count()) + parser.add_argument('--ignore-expected', dest='ignore_expected', action='store_true', + help='ignore expected scores from config.yml. When this flag is set, ' + 'the expected scores are not compared with the actual scores. ' + 'This flag will be passed to the run command.') parsers.add_compilation_arguments(parser) def remove_cache(self):