Skip to content

Commit

Permalink
fix: multiple-dependencies should work with only devDeps (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuiiBz authored Nov 9, 2023
1 parent 7ca1b99 commit 943d398
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ pub fn collect_issues(args: &Args, packages_list: PackagesList) -> IssuesList<'_
issues.add(package_type.clone(), package.check_peer_dependencies());
issues.add(package_type.clone(), package.check_optional_dependencies());

if let Some(mut dependencies) = package.get_dependencies() {
let mut joined_dependencies = IndexMap::new();

if let Some(dependencies) = package.get_dependencies() {
if package.is_private() {
let types_in_dependencies = dependencies
.iter()
Expand All @@ -137,17 +139,19 @@ pub fn collect_issues(args: &Args, packages_list: PackagesList) -> IssuesList<'_
}
}

if let Some(dev_dependencies) = package.get_dev_dependencies() {
dependencies.extend(dev_dependencies);
}
joined_dependencies.extend(dependencies);
}

for (name, version) in dependencies {
if !version.comparators.is_empty() {
all_dependencies
.entry(name)
.or_insert_with(IndexMap::new)
.insert(package.get_path(), version);
}
if let Some(dev_dependencies) = package.get_dev_dependencies() {
joined_dependencies.extend(dev_dependencies);
}

for (name, version) in joined_dependencies {
if !version.comparators.is_empty() {
all_dependencies
.entry(name)
.or_insert_with(IndexMap::new)
.insert(package.get_path(), version);
}
}
}
Expand Down

0 comments on commit 943d398

Please sign in to comment.