Draft: refactor cli with annotate-snippets
#939
Draft
+188
−117
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.
Opening this PR not to merge immediately (or even ever) but to show what we could do with
annotate-snippets
and get feedback on the CLI design (to be more rustc/clippy-like).Screenshots:
cargo semver-checks --baseline-root test_crates/function_const_removed/old --manifest-path test_crates/function_const_removed/new -Z unstable-options --witness-hints
old
new
when file is not available for span
on
manifest_tests/workspace_overrides
test crate (warnings + errors)old
new
On compatibility with clippy/rustc:
This is mostly just a port of our current failure printing to use
annotate-snippets
(and adding printing the one-line span snippet).clippy
/rustc
linters show generally less information per lint, and don't group instances of lints occurring by lint type. We group all lint results and print lots of info for each lint (description, ref link, info link) as well as per-result error info.sample clippy/rustc lints
I don't know if we actually want parity with
rustc
in this regard, though.