-
-
Notifications
You must be signed in to change notification settings - Fork 84
feat: Implement clippy support #667
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
base: main
Are you sure you want to change the base?
Conversation
|
Just a skeleton for now # Conflicts: # example/.aspect/cli/config.yaml # example/lint.sh # example/tools/lint/linters.bzl
# Conflicts: # example/MODULE.bazel
lint/clippy.bzl
Outdated
| Typical usage: | ||
| First, install `rules_rust` into your repository: https://bazelbuild.github.io/rules_rust/. For instance: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it require some minimum version of rules_rust to pick up your changes? would be good to document
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, it needs 0.67.0. Added a comment.
alexeagle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some initial comments between meetings - awesome!
| If there is a success marker but the output is not empty, we mark it as a failure. | ||
| If there is no success marker, the action has failed anyway. | ||
| Please note that all clippy warnings are considered failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a TODO or "watch issue 385 for updates" here too right? It's not desirable behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, added a comment.
|
I am not sure how, but that buildkite build is failing on this PR, but also failing on my local checkout of @alexeagle do you know why it might have passed on your PR #668? |
| ) | ||
| _marker_to_exit_code(ctx, machine_success_indicator, outputs.machine.out, outputs.machine.exit_code) | ||
|
|
||
| # FIXME: Rustc only gives us JSON output, which we can't turn into SARIF yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory https://github.com/reviewdog/errorformat/blob/master/fmts/rust.go should guide us to the answer


Adds clippy support to rules_lint, which is part of #385. It does not support
--fixyet, as there are some complications with applying the patches generated by rules_rust.Caveats:
fixdoesn't work.rules_rustwill fail the entire execution if there's even one error, so we need to limit the reports to just warnings so that we can continue the target execution and generate useful output files. Because we limit all errors to warnings, we must consider every warning as an error.Changes are visible to end-users: yes
MODULE.lockresolution.Test plan
cd examples && bazel test //test:clippy_ok_binary_with_bad_dep //test:clippy_bad_binary //test:clippy_bad_library