From 8d7ce5c4513a54416fd3d29d8194c8f5a292ee51 Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Tue, 9 Jul 2024 13:45:04 +0000 Subject: [PATCH] Update `upexpected_cfgs` syntax --- Cargo.toml | 17 +++++++++-------- README.md | 14 ++++++-------- cargo-dylint/README.md | 14 ++++++-------- driver/Cargo.toml | 7 +++---- dylint/README.md | 14 ++++++-------- .../experimental/derive_opportunity/Cargo.toml | 7 +++---- .../missing_doc_comment_openai/Cargo.toml | 7 +++---- examples/general/Cargo.toml | 7 +++---- examples/restriction/Cargo.toml | 7 +++---- examples/supplementary/Cargo.toml | 7 +++---- examples/testing/clippy/Cargo.toml | 7 +++---- examples/testing/marker/Cargo.toml | 7 +++---- examples/testing/straggler/Cargo.toml | 7 +++---- utils/linting/Cargo.toml | 7 +++---- 14 files changed, 57 insertions(+), 72 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 557d2a9b7..7d7b20567 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,14 +15,15 @@ members = [ ] resolver = "2" -[workspace.lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(coverage)', - 'cfg(dylint_lib, values(any()))', - 'cfg(__cargo_cli)', - 'cfg(__cargo_lib)', - 'cfg(__library_packages)', -] } +[workspace.lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = [ + "cfg(coverage)", + "cfg(dylint_lib, values(any()))", + "cfg(__cargo_cli)", + "cfg(__cargo_lib)", + "cfg(__library_packages)", +] [workspace.metadata.dylint] libraries = [ diff --git a/README.md b/README.md index 0fe94d504..9bc74ff5f 100644 --- a/README.md +++ b/README.md @@ -125,19 +125,17 @@ As of nightly-2024-05-05, the names and values of every reachable `#[cfg]` [are To suppress such warnings, add the following to your packages' Cargo.toml files: ```toml -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(dylint_lib, values(any()))"] ``` Or, if you're using a Cargo workspace, add the following the workspace's Cargo.toml file: ```toml -[workspace.lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[workspace.lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(dylint_lib, values(any()))"] ``` Then, add the following to the Cargo.toml file of each package in the workspace: diff --git a/cargo-dylint/README.md b/cargo-dylint/README.md index 46cf43e1f..0066de1ec 100644 --- a/cargo-dylint/README.md +++ b/cargo-dylint/README.md @@ -125,19 +125,17 @@ As of nightly-2024-05-05, the names and values of every reachable `#[cfg]` [are To suppress such warnings, add the following to your packages' Cargo.toml files: ```toml -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(dylint_lib, values(any()))"] ``` Or, if you're using a Cargo workspace, add the following the workspace's Cargo.toml file: ```toml -[workspace.lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[workspace.lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(dylint_lib, values(any()))"] ``` Then, add the following to the Cargo.toml file of each package in the workspace: diff --git a/driver/Cargo.toml b/driver/Cargo.toml index 52afa0f7d..e83022019 100644 --- a/driver/Cargo.toml +++ b/driver/Cargo.toml @@ -22,10 +22,9 @@ dylint_internal = { version = "=3.1.2", path = "../internal", features = [ [dev-dependencies] rustc_version = "0.4" -[lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = ["cfg(dylint_lib, values(any()))"] [workspace] diff --git a/dylint/README.md b/dylint/README.md index 46cf43e1f..0066de1ec 100644 --- a/dylint/README.md +++ b/dylint/README.md @@ -125,19 +125,17 @@ As of nightly-2024-05-05, the names and values of every reachable `#[cfg]` [are To suppress such warnings, add the following to your packages' Cargo.toml files: ```toml -[lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(dylint_lib, values(any()))"] ``` Or, if you're using a Cargo workspace, add the following the workspace's Cargo.toml file: ```toml -[workspace.lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[workspace.lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = ["cfg(dylint_lib, values(any()))"] ``` Then, add the following to the Cargo.toml file of each package in the workspace: diff --git a/examples/experimental/derive_opportunity/Cargo.toml b/examples/experimental/derive_opportunity/Cargo.toml index a383b6441..3112e723e 100644 --- a/examples/experimental/derive_opportunity/Cargo.toml +++ b/examples/experimental/derive_opportunity/Cargo.toml @@ -35,10 +35,9 @@ serde_derive = "1.0" dylint_testing = { path = "../../../utils/testing" } -[lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = ["cfg(dylint_lib, values(any()))"] [package.metadata.rust-analyzer] rustc_private = true diff --git a/examples/experimental/missing_doc_comment_openai/Cargo.toml b/examples/experimental/missing_doc_comment_openai/Cargo.toml index 35d57fc54..2e936f064 100644 --- a/examples/experimental/missing_doc_comment_openai/Cargo.toml +++ b/examples/experimental/missing_doc_comment_openai/Cargo.toml @@ -20,10 +20,9 @@ dylint_linting = { path = "../../../utils/linting" } [dev-dependencies] dylint_testing = { path = "../../../utils/testing" } -[lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = ["cfg(dylint_lib, values(any()))"] [package.metadata.rust-analyzer] rustc_private = true diff --git a/examples/general/Cargo.toml b/examples/general/Cargo.toml index b6e30203d..2019b6261 100644 --- a/examples/general/Cargo.toml +++ b/examples/general/Cargo.toml @@ -48,10 +48,9 @@ members = [ [workspace.dependencies] clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "3e5a02b13b1244545454752c6629b767522a44b1" } -[workspace.lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[workspace.lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = ["cfg(dylint_lib, values(any()))"] [workspace.metadata.dylint] libraries = [ diff --git a/examples/restriction/Cargo.toml b/examples/restriction/Cargo.toml index d1c7afc33..790a5a0a1 100644 --- a/examples/restriction/Cargo.toml +++ b/examples/restriction/Cargo.toml @@ -17,10 +17,9 @@ resolver = "2" [workspace.dependencies] clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "3e5a02b13b1244545454752c6629b767522a44b1" } -[workspace.lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[workspace.lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = ["cfg(dylint_lib, values(any()))"] [workspace.metadata.dylint] libraries = [ diff --git a/examples/supplementary/Cargo.toml b/examples/supplementary/Cargo.toml index 7e6b3c1c9..b00f0cd71 100644 --- a/examples/supplementary/Cargo.toml +++ b/examples/supplementary/Cargo.toml @@ -41,10 +41,9 @@ members = [ [workspace.dependencies] clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "3e5a02b13b1244545454752c6629b767522a44b1" } -[workspace.lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[workspace.lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = ["cfg(dylint_lib, values(any()))"] [workspace.metadata.dylint] libraries = [ diff --git a/examples/testing/clippy/Cargo.toml b/examples/testing/clippy/Cargo.toml index 328d33a84..eda6a27bd 100644 --- a/examples/testing/clippy/Cargo.toml +++ b/examples/testing/clippy/Cargo.toml @@ -29,10 +29,9 @@ dylint = { path = "../../../dylint" } dylint_internal = { path = "../../../internal", features = ["git"] } dylint_testing = { path = "../../../utils/testing" } -[lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = ["cfg(dylint_lib, values(any()))"] [package.metadata.rust-analyzer] rustc_private = true diff --git a/examples/testing/marker/Cargo.toml b/examples/testing/marker/Cargo.toml index c4bd59ec2..e86d8c1a8 100644 --- a/examples/testing/marker/Cargo.toml +++ b/examples/testing/marker/Cargo.toml @@ -30,10 +30,9 @@ tempfile = "3.10" dylint_internal = { path = "../../../internal", features = ["cargo", "git"] } -[lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = ["cfg(dylint_lib, values(any()))"] [package.metadata.rust-analyzer] rustc_private = true diff --git a/examples/testing/straggler/Cargo.toml b/examples/testing/straggler/Cargo.toml index 6211b3523..706489289 100644 --- a/examples/testing/straggler/Cargo.toml +++ b/examples/testing/straggler/Cargo.toml @@ -18,10 +18,9 @@ dylint_linting = { path = "../../../utils/linting" } [dev-dependencies] dylint_testing = { path = "../../../utils/testing" } -[lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = ["cfg(dylint_lib, values(any()))"] [package.metadata.rust-analyzer] rustc_private = true diff --git a/utils/linting/Cargo.toml b/utils/linting/Cargo.toml index 2b092197b..fbfb74b59 100644 --- a/utils/linting/Cargo.toml +++ b/utils/linting/Cargo.toml @@ -30,10 +30,9 @@ tempfile = "3.10" [features] constituent = [] -[lints.rust] -unexpected_cfgs = { level = "deny", check-cfg = [ - 'cfg(dylint_lib, values(any()))', -] } +[lints.rust.unexpected_cfgs] +level = "deny" +check-cfg = ["cfg(dylint_lib, values(any()))"] [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"]