Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Handle unexpected_cfgs
  • Loading branch information
smoelius committed Jun 20, 2024
commit c8fabc59dff5564333d4b6d4108e5f09108a0b4a
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ members = [
]
resolver = "2"

[workspace.lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = [
'cfg(dylint_lib, values(any()))',
] }

[workspace.metadata.dylint]
libraries = [
{ path = "examples/general" },
Expand Down
3 changes: 3 additions & 0 deletions cargo-dylint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ cargo-cli = ["dylint/__cargo_cli"]
cargo-lib = ["dylint/__cargo_lib"]
__ci = []
__clap_headings = []

[lints]
workspace = true
5 changes: 5 additions & 0 deletions driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ 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()))',
] }

[workspace]

[workspace.metadata.dylint]
Expand Down
3 changes: 3 additions & 0 deletions dylint-link/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ dylint_internal = { version = "=3.1.2", path = "../internal", features = [
"packaging",
] }

[lints]
workspace = true

[target.'cfg(target_os = "windows")'.dependencies]
cc = "1.0"
3 changes: 3 additions & 0 deletions dylint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ __cargo_lib = [
"toml",
]

[lints]
workspace = true

# smoelius: When both `__cargo_cli` and `__cargo_lib` are enabled, we treat it as though
# `--features=cargo-lib` was passed but the user forgot to pass `--no-default-features`. This
# approach causes `fs_extra` to look like an unused dependency.
Expand Down
3 changes: 3 additions & 0 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ dylint_internal = { version = "=3.1.2", path = "../internal", features = [
"clippy_utils",
"examples",
] }

[lints]
workspace = true
5 changes: 5 additions & 0 deletions examples/experimental/derive_opportunity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ serde_derive = "1.0"

dylint_testing = { path = "../../../utils/testing" }

[lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = [
'cfg(dylint_lib, values(any()))',
] }

[package.metadata.rust-analyzer]
rustc_private = true

Expand Down
5 changes: 5 additions & 0 deletions examples/experimental/missing_doc_comment_openai/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ 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()))',
] }

[package.metadata.rust-analyzer]
rustc_private = true

Expand Down
5 changes: 5 additions & 0 deletions examples/general/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ members = [
[workspace.dependencies]
clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "1325425589efdaf4bba99c37f0d80030ab53aac5" }

[workspace.lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = [
'cfg(dylint_lib, values(any()))',
] }

[workspace.metadata.dylint]
libraries = [
{ path = "../general" },
Expand Down
3 changes: 3 additions & 0 deletions examples/general/abs_home_path/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/general/await_holding_span_guard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/general/basic_dead_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/general/crate_wide_allow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/general/incorrect_matches_operation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/general/non_thread_safe_call_in_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/general/wrong_serialize_struct_arg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
5 changes: 5 additions & 0 deletions examples/restriction/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ resolver = "2"
[workspace.dependencies]
clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "1325425589efdaf4bba99c37f0d80030ab53aac5" }

[workspace.lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = [
'cfg(dylint_lib, values(any()))',
] }

[workspace.metadata.dylint]
libraries = [
{ path = "../general" },
Expand Down
3 changes: 3 additions & 0 deletions examples/restriction/assert_eq_arg_misordering/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ dylint_linting = { path = "../../../utils/linting" }
[dev-dependencies]
dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/restriction/collapsible_unwrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ toml = "0.8"

dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/restriction/const_path_join/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ camino = "1.1"

dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/restriction/env_literal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ dylint_linting = { path = "../../../utils/linting" }
[dev-dependencies]
dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/restriction/inconsistent_qualification/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ diesel = "2.2"

dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/restriction/misleading_variable_name/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ cargo_metadata = "0.18"

dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/restriction/overscoped_allow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ tempfile = "3.10"

dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/restriction/question_mark_in_expression/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ tempfile = "3.10"

dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ dylint_linting = { path = "../../../utils/linting" }
[dev-dependencies]
dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/restriction/suboptimal_pattern/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ dylint_linting = { path = "../../../utils/linting" }
[dev-dependencies]
dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/restriction/try_io_result/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ anyhow = "1.0"

dylint_testing = { path = "../../../utils/testing" }

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
5 changes: 5 additions & 0 deletions examples/supplementary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ members = [
[workspace.dependencies]
clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "1325425589efdaf4bba99c37f0d80030ab53aac5" }

[workspace.lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = [
'cfg(dylint_lib, values(any()))',
] }

[workspace.metadata.dylint]
libraries = [
{ path = "../general" },
Expand Down
3 changes: 3 additions & 0 deletions examples/supplementary/commented_code/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/supplementary/escaping_doc_link/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/supplementary/local_ref_cell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/supplementary/redundant_reference/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/supplementary/unnamed_constant/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
3 changes: 3 additions & 0 deletions examples/supplementary/unnecessary_borrow_mut/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@ dylint_testing = { path = "../../../utils/testing" }
[features]
rlib = ["dylint_linting/constituent"]

[lints]
workspace = true

[package.metadata.rust-analyzer]
rustc_private = true
5 changes: 5 additions & 0 deletions examples/testing/clippy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ 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()))',
] }

[package.metadata.rust-analyzer]
rustc_private = true

Expand Down
5 changes: 5 additions & 0 deletions examples/testing/marker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ tempfile = "3.10"

dylint_internal = { path = "../../../internal", features = ["cargo", "git"] }

[lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = [
'cfg(dylint_lib, values(any()))',
] }

[package.metadata.rust-analyzer]
rustc_private = true

Expand Down
5 changes: 5 additions & 0 deletions examples/testing/straggler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ 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()))',
] }

[package.metadata.rust-analyzer]
rustc_private = true

Expand Down
3 changes: 3 additions & 0 deletions internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ packaging = ["cargo", "rust-embed"]
rustup = ["command"]
sed = ["regex"]
testing = ["ctor", "env_logger", "packaging"]

[lints]
workspace = true
Loading