Cargo diff-tools
Run cargo check
and cargo clippy
hiding the warning messages whose primary line is not included in a git diff
. Useful in large projects to hide warning messages that are probably not related to the changes made by a pull request.
Inspired by Patryk27/clippy-dirty
.
Examples
Run cargo clippy
hiding the warning messages whose primary line is not included in a git origin/master HEAD
:
The same, for cargo check
:
Various git diff
arguments are supported:
Place cargo check
arguments after a --
:
Place cargo clippy
arguments after a --
(note that the second --
is one of clippy
's arguments):
To display diagnostics as JSON objects, use --output=json
:
To display diagnostics as workflow commands in GitHub Actions (useful to automatically add comments to pull requests), use --output=github
:
# Example output "::warning file=lib.rs,line=4,col=2::Missing semicolon"
For other cargo
commands, filter-by-diff
can be used to filter any stream of JSON diagnostics:
|