Skip to content

Commit

Permalink
Remove reporting of rejected parts during target expand (#23120)
Browse files Browse the repository at this point in the history
* Remove reporting of rejected parts during target expand

* Restyle

* Remove invalid comment
  • Loading branch information
andy31415 authored and pull[bot] committed Feb 2, 2024
1 parent e7f4446 commit f36c89b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/build/build/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
from typing import Any, Dict, List, Iterable, Optional


report_rejected_parts = True


@dataclass(init=False)
class TargetPart:
# SubTarget/Modifier name
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions scripts/build/build_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f36c89b

Please sign in to comment.