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

Move to using Cargo.toml [lints] #5974

Open
Manishearth opened this issue Jan 10, 2025 · 2 comments · May be fixed by #5976
Open

Move to using Cargo.toml [lints] #5974

Manishearth opened this issue Jan 10, 2025 · 2 comments · May be fixed by #5976
Assignees
Labels
C-test-infra Component: Integration test infrastructure S-medium Size: Less than a week (larger bug fix or enhancement)

Comments

@Manishearth
Copy link
Member

This is our current lint boilerplate

#![cfg_attr(
    not(test),
    deny(
        clippy::indexing_slicing,
        clippy::unwrap_used,
        clippy::expect_used,
        clippy::panic,
        clippy::exhaustive_structs,
        clippy::exhaustive_enums,
        missing_debug_implementations,
    )
)]
#![warn(missing_docs)]

We are now on Rust 1.81, and can instead use Cargo's [lints] table, and Workspace lints, so that this can be defined in one place.

The cfg(test) matters more for the panicky lints: These can instead be covered by the Clippy allow_panic_in_tests, allow_expect_in_tests, allow_unwrap_in_tests. allow_indexing_slicing_in_tests configs. A similar config could be added to the exhaustiveness lints but we have a very small number of structs/enums in tests and we can just allow there.

cc @robertbastian @sffc

@Manishearth Manishearth self-assigned this Jan 10, 2025
@Manishearth
Copy link
Member Author

Some issues for doing this now:

@Manishearth Manishearth linked a pull request Jan 10, 2025 that will close this issue
@Manishearth
Copy link
Member Author

I have a partial attempt at this in #5976

The commit "allow some lints in some crates" (f4d0e97) shows some places where we could add lints today to make things easier in the future.

@Manishearth Manishearth added this to the Backlog ⟨P4⟩ milestone Jan 15, 2025
@Manishearth Manishearth added C-test-infra Component: Integration test infrastructure S-medium Size: Less than a week (larger bug fix or enhancement) labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-test-infra Component: Integration test infrastructure S-medium Size: Less than a week (larger bug fix or enhancement)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant