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

chore: make VS Code rust-analyzer run just clippy #238

Merged
merged 1 commit into from
Aug 16, 2023
Merged

Conversation

hawkw
Copy link
Contributor

@hawkw hawkw commented Aug 16, 2023

This commit changes the VS Code settings so that rust-analyzer will run the just clippy command instead of cargo clippy when running checks. Because the just clippy command will check all crates in the workspace, not just the default members, this means VS Code users will get clippy warnings/errors for all crates in the workspace, even the ones that can't be checked as part of a global cargo clippy --workspace command. This should substantially improve the dev experience for VS Code users.

This change required adding an optional trailing ARGS argument to the just clippy recipe so that additional args can be passed to Clippy (in this case --message-format=json --quiet --all-targets, to mimic the way rust-analyzer normally invokes cargo check).

This commit changes the VS Code settings so that rust-analyzer will run
the `just clippy` command instead of `cargo clippy` when running checks.
Because the `just clippy` command will check all crates in the
workspace, not just the default members, this means VS Code users will
get clippy warnings/errors for *all* crates in the workspace, even the
ones that can't be checked as part of a global `cargo clippy
--workspace` command. This should substantially improve the dev
experience for VS Code users.

This change required adding an optional trailing `ARGS` argument to the
`just clippy` recipe so that additional args can be passed to Clippy (in
this case `--message-format=json --quiet --all-targets`, to mimic the
way `rust-analyzer` normally invokes `cargo check`).
@hawkw hawkw self-assigned this Aug 16, 2023
@hawkw hawkw merged commit 5f25821 into main Aug 16, 2023
7 checks passed
@hawkw hawkw deleted the eliza/vscode-just branch August 16, 2023 23:39
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.

None yet

1 participant