Skip to content

Commit

Permalink
Skip checking [dev-dependencies] features (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav authored Oct 27, 2022
1 parent 1d68bd5 commit 3e84b4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/core/src/check/features/mock-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@ version = "0.0.0"
# hack-ink
a = { package = "general-a", default-features = false, path = "general/a" }
general-b = { default-features = false, path = "general/b" }
general-c = { default-features = false, path = "general/c" }
pallet-a = { default-features = false, path = "pallet/a" }
pallet-b = { default-features = false, path = "pallet/b" }
pallet-c = { default-features = false, path = "pallet/c" }
primitive-a = { default-features = false, path = "primitive/a" }
primitive-b = { default-features = false, path = "primitive/b" }
primitive-c = { default-features = false, path = "primitive/c" }

[dev-dependencies]
general-c = { path = "general/c" }

[features]
default = ["std"]
std = [
# hack-ink
"a/std",
"general-b/std",
"general-c/std",
# "pallet-a/std",
"pallet-b/std",
"pallet-c/std",
Expand Down
7 changes: 6 additions & 1 deletion lib/core/src/check/features/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[cfg(test)] mod test;

// crates.io
use cargo_metadata::{Metadata, Node};
use cargo_metadata::{DependencyKind, Metadata, Node};
// hack-ink
use crate::{
cargo::{self, GetById},
Expand Down Expand Up @@ -53,6 +53,11 @@ fn check_feature(
let mut problem_pkgs = Vec::new();

for dep in &root_node.deps {
// Skip the `[dep-dependencies]`
if dep.dep_kinds.iter().any(|kind| matches!(kind.kind, DependencyKind::Development)) {
continue;
}

let pkg_id = &dep.pkg;
let pkg_name = pkg_id
.repr
Expand Down

0 comments on commit 3e84b4a

Please sign in to comment.