-
-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add .cargo/config.toml for workspace-level lint config
Currently it is not directly possible to configure lints for the entire workspace via TOML, which forced us to repeat `#![allow]` blocks in each crate. embark pointed out this workaround to configure lints at the workspace level via RUSTFLAGS: EmbarkStudios/rust-ecosystem#22 (comment) Remove the common `#![allow]` blocks and switch to this method for global lint config. Temporarily allow `needless_borrow` lint, buggy pending this fix: rust-lang/rust-clippy#8355
- Loading branch information
Showing
10 changed files
with
25 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[target.'cfg(all())'] | ||
rustflags = [ | ||
# CLIPPY LINT SETTINGS | ||
# This is a workaround to configure lints for the entire workspace, pending the ability to configure this via TOML. | ||
# See: https://github.com/rust-lang/cargo/issues/5034 | ||
# https://github.com/EmbarkStudios/rust-ecosystem/issues/22#issuecomment-947011395 | ||
|
||
# Clippy nightly often adds new/buggy lints that we want to ignore. | ||
# Don't warn about these new lints on stable. | ||
"-Arenamed_and_removed_lints", | ||
"-Aunknown_lints", | ||
|
||
# LONG-TERM: These lints are unhelpful. | ||
"-Aclippy::manual_map", # Less readable: Suggests `opt.map(..)` instsead of `if let Some(opt) { .. }` | ||
"-Aclippy::manual_range_contains", # Less readable: Suggests `(a..b).contains(n)` instead of `n >= a && n < b` | ||
|
||
# TEMPORARY: Buggy lints that will hopefully be fixed soon. | ||
"-Aclippy::needless_borrow", # https://github.com/rust-lang/rust-clippy/pull/8355 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters