This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
fix(rome_cli): correctly account for diff diagnostics in the printed diagnostics count #3595
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3593
This PR adds checks against the
printed_diagnostics
counter in the console thread for diff diagnostics and general errors. This ensures the CLI never prints more diagnostics than the allowed maximum. I've also extended the--max-diagnostics
argument from thecheck
command to theci
andformat
commands, albeit with a different default value.Test Plan
I've added new tests for this in the CLI test suite but couldn't use the snapshot testing utility since the CLI runs multithreaded, and as a result the order of diagnostics printed in multiple files (for instance in many files formatted in parallel) is not deterministic and changes from one test run to another.