Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: refactor cli with annotate-snippets #939

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

suaviloquence
Copy link
Contributor

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

image

new

image

when file is not available for span

image

on manifest_tests/workspace_overrides test crate (warnings + errors)

old

image

new

image

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

image

I don't know if we actually want parity with rustc in this regard, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant