<#17660 Report all dependency errors for all targe...
# github-notifications
q
#17660 Report all dependency errors for all targets at once in visibility backend New issue created by danxmoran Is your feature request related to a problem? Please describe. #17612 improved the reporting of dependency rule errors, so that all errors for a single target will be reported. However if multiple targets have errors, the system will still only report errors for one target (and after you fix those and re-run, it'll report the errors for the next target, and so on...). This one-at-a-time approach is frustrating to developers - we've specifically heard it about other linters/formatters in the past, and I expect to receive the same feedback if we adopt the visibility backend with its current behavior. Describe the solution you'd like It would be ideal for the dependency-rule system to report all errors for all targets. Describe alternatives you've considered Keep using
import-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