Skip to content

Commit

Permalink
[internal] Ignore empty rule sets. (pantsbuild#17580)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaos authored Nov 18, 2022
1 parent 71a6833 commit 7583d1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/python/pants/backend/visibility/rule_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def set_dependency_rules(
**kwargs,
) -> None:
try:
self.rulesets = [VisibilityRuleSet.parse(arg) for arg in args]
self.rulesets = [VisibilityRuleSet.parse(arg) for arg in args if arg]
self.path = build_file
except ValueError as e:
raise BuildFileVisibilityRulesError(f"{build_file}: {e}") from e
Expand Down
4 changes: 4 additions & 0 deletions src/python/pants/backend/visibility/rule_types_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ def test_dependency_rules(rule_runner: RuleRunner, caplog) -> None:
# Allow all by default, with a warning
("*", "?*"),
# Ignore (accept) empty values as no-op
None,
(),
)
__dependents_rules__(
Expand Down

0 comments on commit 7583d1e

Please sign in to comment.