<#17694 Be able to query BUILD files for informati...
# github-notifications
q
#17694 Be able to query BUILD files for information about the visibility rules declared New issue created by AlexTereshenkov Is your feature request related to a problem? Please describe. It would be helpful to be able to query the visibility rules (
__dependents_rules__
and
__dependencies_rules__
) programmatically, e.g. via the
peek
command. When the rule selectors are expanded to real files, one could answer a variety of questions, e.g. "who is allowed to import this particular Python module?". Having raw globs (like with have
dependencies_raw
in the
peek
) would also do some linting (e.g. "don't forget to add a fall-thorough pattern" or "make sure all 3rd party requirements imported in a module are allowed to depend on in a rule"). Describe the solution you'd like When running
./pants peek project/subdir
, I'd like to get information about the visibility rules defined in a
BUILD
file in this directory (both raw and with expanded paths). Describe alternatives you've considered
peek
works on targets, so maybe making it aware of the visibility rules would complicate the logic. Another auxiliary goal or a separate tooling may also make sense. Linked to #17634. pantsbuild/pants