From 707d320886a0ef59d0b9e3bd39203a44c78e3df3 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 12 Oct 2022 10:59:04 -0400 Subject: [PATCH] Remove reporting of rejected parts during target expand (#23120) * Remove reporting of rejected parts during target expand * Restyle * Remove invalid comment --- scripts/build/build/target.py | 13 +++++++++---- scripts/build/build_examples.py | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/build/build/target.py b/scripts/build/build/target.py index b31de44d514b20..de5de5fbd74718 100644 --- a/scripts/build/build/target.py +++ b/scripts/build/build/target.py @@ -47,6 +47,9 @@ from typing import Any, Dict, List, Iterable, Optional +report_rejected_parts = True + + @dataclass(init=False) class TargetPart: # SubTarget/Modifier name @@ -78,14 +81,16 @@ def ExceptIfRe(self, expr: str): def Accept(self, full_input: str): if self.except_if_re: if self.except_if_re.search(full_input): - # likely nothing will match when we get such an error - logging.error(f"'{self.name}' does not support '{full_input}' due to rule EXCEPT IF '{self.except_if_re.pattern}'") + if report_rejected_parts: + # likely nothing will match when we get such an error + logging.error(f"'{self.name}' does not support '{full_input}' due to rule EXCEPT IF '{self.except_if_re.pattern}'") return False if self.only_if_re: if not self.only_if_re.search(full_input): - # likely nothing will match when we get such an error - logging.error(f"'{self.name}' does not support '{full_input}' due to rule ONLY IF '{self.only_if_re.pattern}'") + if report_rejected_parts: + # likely nothing will match when we get such an error + logging.error(f"'{self.name}' does not support '{full_input}' due to rule ONLY IF '{self.only_if_re.pattern}'") return False return True diff --git a/scripts/build/build_examples.py b/scripts/build/build_examples.py index b95a006c18458f..5f8a7ef2a5c7bd 100755 --- a/scripts/build/build_examples.py +++ b/scripts/build/build_examples.py @@ -162,6 +162,7 @@ def cmd_generate(context): def cmd_targets(context, expand): for target in build.targets.BUILD_TARGETS: if expand: + build.target.report_rejected_parts = False for s in target.AllVariants(): print(s) else: