From 4e99bb69de568230f391c51193f4e05fbbe25a78 Mon Sep 17 00:00:00 2001 From: Simon Dold Date: Mon, 4 Mar 2024 17:35:03 +0100 Subject: [PATCH] add exceptions. --- misc/style/check-parameter-order.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/misc/style/check-parameter-order.py b/misc/style/check-parameter-order.py index a78ad03f52..0b74312321 100755 --- a/misc/style/check-parameter-order.py +++ b/misc/style/check-parameter-order.py @@ -7,11 +7,24 @@ import sys SHART_HANDS = { - "ipdb" : "cpdbs(hillclimbing())", + "ipdb": "cpdbs(hillclimbing())", + "astar": "eager(tiebreaking([sum([g(), h]), h], unsafe_pruning=false), reopen_closed=true, f_eval=sum([g(), h]))", + "lazy_greedy": "lazy(alt([single(h1), single(h1, pref_only=true), single(h2), single(h2, pref_only=true)], boost=100), preferred=h2)", + "lazy_wastar": "lazy(single(sum([g(), weight(eval1, 2)])), reopen_closed=true)", + "eager_greedy": "eager(single(eval1))", + "eager_wastar": """ See corresponding notes for "(Weighted) A* search (lazy)" """, } +TEMPORARY_EXCEPTIONS = [ + "iteraded" +] + +PERMANENT_EXCEPTIONS = [ + "adapt_costs" +] + CONTRUCTOR_REGEX = r"\b(\w+)(?:\s*::\s*\1\b)+" CREATE_COMPONENT_REGEX = r"(^|\s|\W)create_component" C_VAR_PATTERN = r'[^a-zA-Z0-9_]' # overapproximation @@ -147,7 +160,11 @@ def compare_component_parameters(cc_file, args): if feature_name in SHART_HANDS: print(f"feature_name '{feature_name}' would trigger an error if it was not marked as shorthand") - if feature_parameters != cpp_class_parameters and feature_name not in SHART_HANDS : + elif feature_name in PERMANENT_EXCEPTIONS: + print(f"feature_name '{feature_name}' would trigger an error if it was not marked as PERMANENT_EXCEPTION") + elif feature_name in TEMPORARY_EXCEPTIONS: + print(f"feature_name '{feature_name}' would trigger an error if it was not marked as TEMPORARY_EXCEPTION") + elif feature_parameters != cpp_class_parameters: found_error = True if not len(feature_parameters) == len(cpp_class_parameters): error_msg += "Wrong sizes\n"