quaint-telephone-89068
11/28/2022, 3:28 PMimport-linter instead of the visibility backend 🤢
Additional context
AIUI, this would require changing the API of the dependency-rule system. Currently the core dependency resolution rule requests ValidatedDependencies but throws away the result here:
pants/src/python/pants/engine/internals/graph.py
Lines 1304 to 1315 in </pantsbuild/pants/commit/a4054868c11690874005999cb80100e4da107538|a405486>
So implementations of ValidateDependenciesRequest -> ValidatedDependencies have no choice but to raise an exception on a dependency error, and the first error raised is the one that gets reported.
IMO a better API would always return a value - conceptually something like Rust's Result, though I'm not sure how best to model that in Python. The core logic could then loop over all the results, log errors, and raise some error to bail out if needed.
pantsbuild/pants