Skip to content

Commit

Permalink
More precise nostd lint
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez committed Apr 10, 2024
1 parent c72cce2 commit bb8c093
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"rust-analyzer.showUnlinkedFileNotification": false
}
2 changes: 1 addition & 1 deletion src/cmd/lint/nostd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl DefaultFeaturesDisabledCmd {
let ret = if content.contains("#![cfg_attr(not(feature = \"std\"), no_std)]") ||
content.contains("#![no_std]")
{
if content.contains("#![cfg(") {
if content.contains("\n#![cfg(") {
println!(
"{}: Crate may unexpectedly pull in libstd: {}",
g.yellow("WARN"),
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/sdk/nostd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ cases:
stdout: |
Default features not disabled for dependency: sp-core -> sp-externalities
WARN: Crate may unexpectedly pull in libstd: frame-try-runtime
WARN: Crate may unexpectedly pull in libstd: frame-benchmarking
Default features not disabled for dependency: sp-session -> sp-runtime
Default features not disabled for dependency: sp-consensus-babe -> sp-timestamp
WARN: Crate may unexpectedly pull in libstd: frame-system-benchmarking
Expand Down Expand Up @@ -41,7 +40,6 @@ cases:
stdout: |
Default features not disabled for dependency: sp-core -> sp-externalities
WARN: Crate may unexpectedly pull in libstd: frame-try-runtime
WARN: Crate may unexpectedly pull in libstd: frame-benchmarking
Default features not disabled for dependency: sp-session -> sp-runtime
Default features not disabled for dependency: sp-consensus-babe -> sp-timestamp
WARN: Crate may unexpectedly pull in libstd: frame-system-benchmarking
Expand Down

0 comments on commit bb8c093

Please sign in to comment.