<#17873 Improve UI of visibility declarations> Iss...
# github-notifications
q
#17873 Improve UI of visibility declarations Issue created by thejcannon Is your feature request related to a problem? Please describe.
Copy code
(
      (
        "!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:
Copy code
{
      ("!tests/**", "!src/*/*/**"): ("*",),
}
* * * Additionally, using objects could also force grokkability:
Copy code
(
      GlobSelector(
        "!tests/**",
        "!src/*/*/**",
      ),
      VisibilityRule(
        "*",
      ),
    ),
  ),
* * * Additionally, the selector patterns introduce even more can't-be-grokked syntax:
Copy code
(
    (
      "python_*(any-python)",
      "*(libs)",
      "[special-cased.py]",
    ),
    ...
  )
Objects could help as well:
Copy code
(
    (
      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