quaint-telephone-89068
12/23/2022, 5:31 PM(
(
"!tests/**",
"!src/*/*/**",
),
(
"*",
),
),
),
is very unfriendly to grok (almost impossible unless you're already entrenched in the syntax).
Describe the solution you'd like
I'm not going to prescribe any one solution, but suggest that the solution help the reader understand the values that are being declared.
A mapping could help readability:
{
("!tests/**", "!src/*/*/**"): ("*",),
}
* * *
Additionally, using objects could also force grokkability:
(
GlobSelector(
"!tests/**",
"!src/*/*/**",
),
VisibilityRule(
"*",
),
),
),
* * *
Additionally, the selector patterns introduce even more can't-be-grokked syntax:
(
(
"python_*(any-python)",
"*(libs)",
"[special-cased.py]",
),
...
)
Objects could help as well:
(
(
Selector(target_type="python_*", tag="any-python"),
Selector(tag="libs"),
Selector(path="special-cased.py"),
),
...
)
(or other similar techniques, or a combination)
Describe alternatives you've considered
Macros are not a sufficient replacement, as our documentation shouldn't suggest them, and users aren't forced to use them.
I want this to be easy to grok for everyone by default ;)
Additional context
I still <3 visibility and a;; y'all.
pantsbuild/pants