clean-night-52582
04/28/2021, 7:00 AMhundreds-father-404
04/28/2021, 7:59 AM::
(glob for all targets) wouldn't operate on BUILD files. But that's something we need to figure out and it speaks to a shortcoming of the current Pants concept of targets
Would you want to open an issue to trick this? I couldn't find onebuild_files
target with default sources = ("**/BUILD",)
, where we anticipate only having a single target in your whole repo to capture your BUILD files. That's a bit awkward, but it works and hooks up Black/isort seamlessly
Some rough edges though that need to be figured out:
1. In order to get the formatters to work, we mark BuildFilesSources
as subclassing PythonSources
- this causes linters like Flake8 and Bandit to also think they can operate on BUILD files, even though they cannot
2. Right now, file arguments and --changed-since
resolve a BUILD file to all of the targets defined within it. So, if you were to do ./pants fmt path/to/BUILD
, it will fmt not only the BUILD file, but also the targets defined there - that is suprising