Skip to content

internal: Add clippy to CI #16413

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

Merged
merged 4 commits into from
Jan 30, 2024
Merged

internal: Add clippy to CI #16413

merged 4 commits into from
Jan 30, 2024

Conversation

Urhengulas
Copy link
Contributor

@Urhengulas Urhengulas commented Jan 21, 2024

Follow-up to #16401

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 21, 2024
@Urhengulas Urhengulas force-pushed the clippy-ci branch 2 times, most recently from 4a4f41d to c79f0f3 Compare January 21, 2024 23:33
@Urhengulas Urhengulas changed the title internal: Add clippy and rustfmt to CI internal: Add clippy to CI Jan 22, 2024
@@ -103,6 +103,10 @@ jobs:
RUSTC_BOOTSTRAP: 1
run: target/${{ matrix.target }}/debug/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std

- name: clippy
if: matrix.os == 'ubuntu-latest'
run: cargo clippy --all-targets -- -D warnings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this enable all clippy warnings or specifically only the ones we list in the Cargo.toml files? We only want the latter as we want direct control of the lints.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does enable all warnings.

The approach I took is enabling all warnings, and then ignoring (aka. "allow"ing) all warnings we do not care about. Some warnings gonna be ignored forever, but some others are gonna be worked on (as happened in e.g. #16404).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also only enable ("deny" in clippy jargon) the lints we care about, but I prefer the approach of considering all clippy lints, except we find them to be not fitting to our needs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah wait now I see. I'm confused as to why we pass -D warnings here, thats not a clippy lint group and clippy should check normal rustc warnings by default no? All the other groups that are relevant we have enabled in the lints table already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Gonna remove that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the purpose of that flag is to make clippy error out if there is any warning. But we can configure that more fine grained in the lint table.

@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2024
@Urhengulas Urhengulas requested a review from Veykril January 30, 2024 10:44
@Urhengulas
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 30, 2024
@Urhengulas
Copy link
Contributor Author

Fixed the new clippy errors which landed on master while this PR is open. Let's try to merge it soon, otherwise we need to fix more clippy errors.

@Veykril
Copy link
Member

Veykril commented Jan 30, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Jan 30, 2024

📌 Commit 43b1ae0 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jan 30, 2024

⌛ Testing commit 43b1ae0 with merge da4d5f8...

@bors
Copy link
Contributor

bors commented Jan 30, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing da4d5f8 to master...

@bors bors merged commit da4d5f8 into rust-lang:master Jan 30, 2024
@Urhengulas Urhengulas deleted the clippy-ci branch January 30, 2024 16:02
@lnicola
Copy link
Member

lnicola commented Feb 5, 2024

Our builds are a little lopsided, anyone opposed to running Clippy on Windows?

image

@Veykril
Copy link
Member

Veykril commented Feb 5, 2024

👍

@flodiebold
Copy link
Member

Clippy really belongs on Windows anyway 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants