flat-zoo-31952
09/03/2022, 11:14 AMhundreds-father-404
09/03/2022, 5:53 PM./pants list path/to/file.py
and make sure wc -l
is 1. That is slow if you need to check every file because invoking Pants N times is slow
So, you could then use peek
and inspect the JSON I guess, but that's complicated
If you want to do this check in CI, the simplest thing may be to develop a new goal check-single-owners
. Request AllTargets
and probably get SourcesPaths
for each target -- make sure they is no overlpaflat-zoo-31952
09/04/2022, 12:42 PMsources_paths = await MultiGet(
Get(SourcesPaths, SourcesPathsRequest(tgt.get(SourcesField))) for tgt in targets
)
counter = Counter(file for sp in sources_paths for file in sp.files)
seems to do the trick, although it might be useful to find owners too to help with output, i'll iterate on this