Skip to content

Add unstable cargo lint tables and make use of clippy #15017

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

Closed
wants to merge 3 commits into from

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Jun 9, 2023

Figured we can allow all lints and then selectively disable the ones we don't want. The nice thing is this doesn't break stable builds, although it does spam a bit for each cargo toml ...

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 9, 2023
@Veykril
Copy link
Member Author

Veykril commented Jun 9, 2023

Turns out the autofix command doesn't really work that well with lint tables, so fixing by hand it is

@Veykril
Copy link
Member Author

Veykril commented Jun 9, 2023

Okay, so this is a ton of changes obviously, will take another look at the diff myself later to see if there are any changes here that we aren't too fond of after all (and then add exceptions for it).

@Veykril Veykril marked this pull request as ready for review June 9, 2023 13:15
@Veykril
Copy link
Member Author

Veykril commented Jun 9, 2023

I cant repro the panic locally on windows 😕

@Veykril Veykril force-pushed the clippy branch 3 times, most recently from 264301c to dd07ebf Compare June 9, 2023 18:09
@Veykril
Copy link
Member Author

Veykril commented Jun 10, 2023

@bors try

@bors
Copy link
Contributor

bors commented Jun 10, 2023

⌛ Trying commit dd07ebf with merge 5f82f22...

bors added a commit that referenced this pull request Jun 10, 2023
Add unstable cargo lint tables and make use of clippy

Figured we can allow all lints and then selectively disable the ones we don't want. The nice thing is this doesn't break stable builds, although it does spam a bit for each cargo toml ...
@bors
Copy link
Contributor

bors commented Jun 10, 2023

☀️ Try build successful - checks-actions
Build commit: 5f82f22 (5f82f2226cf010f8ff7b2f87404e36cb43fd5832)

@Veykril Veykril closed this Aug 15, 2023
Urhengulas added a commit to Urhengulas/rust-analyzer that referenced this pull request Jan 19, 2024
bors added a commit that referenced this pull request Jan 19, 2024
Expand lint tables && make clippy happy 🎉

This PR expands the lint tables on `./Cargo.toml` and thereby makes `cargo clippy` exit successfully! 🎉

Fixes #15918

## How?

In the beginning there are some warnings for rustc.

Next, and most importantly, there is the clippy lint table. There are a few sections in there.

First there are the lint groups.

Second there are all lints which are permanently allowed with the reasoning why they are allowed.

Third there is a huge list of temporarily allowed lints. They should be removed in the mid-term, but incur a substantial amount of work, therefore they are allowed for now and can be worked on bit by bit.

Fourth there are all lints which should warn.

Additionally there are a few allow statements in the code for lints which should be permanently allowed in this specific place, but not in the whole code base.

## Follow up work
- [ ] Run clippy in CI
- [ ] Remove tidy test (at least `@Veykril` wrote this in #15017)
- [ ] Work on temporarily allowed lints
@Veykril Veykril deleted the clippy branch August 21, 2024 12:13
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.

3 participants