Skip to content

Commit

Permalink
Update upexpected_cfgs syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Jul 9, 2024
1 parent 5436a0e commit 8d7ce5c
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 72 deletions.
17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 6 additions & 8 deletions cargo-dylint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
14 changes: 6 additions & 8 deletions dylint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions examples/experimental/derive_opportunity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions examples/experimental/missing_doc_comment_openai/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions examples/general/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
7 changes: 3 additions & 4 deletions examples/restriction/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
7 changes: 3 additions & 4 deletions examples/supplementary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
7 changes: 3 additions & 4 deletions examples/testing/clippy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions examples/testing/marker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions examples/testing/straggler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions utils/linting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 8d7ce5c

Please sign in to comment.