Skip to content

Commit

Permalink
fix: Set new Cargo lint to allow 'cfg(pavex_ide_hint)' in Pavex, its …
Browse files Browse the repository at this point in the history
…snapshot tests and its scaffolded projects
  • Loading branch information
LukeMathWalker committed May 22, 2024
1 parent df672e2 commit 38eb192
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/pavex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ repository.workspace = true
license.workspace = true
readme = "README.md"

[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(pavex_ide_hint)'] }

[features]
default = ["server", "server_request_id", "time", "cookie"]

Expand Down
6 changes: 6 additions & 0 deletions libs/pavex_test_runner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ impl TestData {
version = "0.1.0"
edition = "2021"

[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] }

[dependencies]
pavex ={ path = "../../../../../../libs/pavex" }
};
Expand Down Expand Up @@ -355,6 +358,9 @@ impl TestData {
version = "0.1.0"
edition = "2021"

[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ["cfg(pavex_ide_hint)"] }

[dependencies]
pavex ={ path = "../../../../../libs/pavex" }
pavex_cli_client = { path = "../../../../../libs/pavex_cli_client" }
Expand Down
7 changes: 7 additions & 0 deletions libs/pavexc_cli/template/app/Cargo.toml.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ edition = "2021"
path = "src/bin/bp.rs"
name = "bp"

[lints.rust]
# `pavex_ide_hint` is used in Pavex's `f!` macro to "nudge" the IDE
# and force it to provide completions and "go-to-definition" correctly
# for the paths passed to the `f!` macro.
# It must be allowed in all local crates that use `f!`.
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(pavex_ide_hint)'] }

[dependencies]
cargo_px_env = "0.1"
pavex = { {{pavex_package_spec}} }
Expand Down

0 comments on commit 38eb192

Please sign in to comment.