Skip to content

Commit

Permalink
trim dependency names and versions
Browse files Browse the repository at this point in the history
  • Loading branch information
karan-batavia committed Nov 28, 2024
1 parent 51b68eb commit a6caf31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class DependencyPass(cpg: Cpg, buildFiles: List[String], registerPackageId: Stri
}
val packageVersion = packageReference.attribute("Version").map(_.toString()).getOrElse("")
val dependencyNode = NewDependency()
.name(packageName)
.version(packageVersion)
.name(packageName.trim())
.version(packageVersion.trim())
builder.addNode(dependencyNode)
} match {
case Failure(exception) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class DependencyTests extends CSharpCode2CpgFixture {
.withConfig(config)

inside(cpg.dependency.l) { case dep :: Nil =>
dep.name shouldBe " System.Security.Cryptography.Pkcs"
dep.name shouldBe "System.Security.Cryptography.Pkcs"
dep.version shouldBe "6.0.4"
}
}
Expand All @@ -186,7 +186,7 @@ class DependencyTests extends CSharpCode2CpgFixture {
.withConfig(config)

inside(cpg.dependency.l) { case dep :: dep2 :: Nil =>
dep.name shouldBe " System.Security.Cryptography.Pkcs"
dep.name shouldBe "System.Security.Cryptography.Pkcs"
dep.version shouldBe "6 .0.4"
}
}
Expand Down

0 comments on commit a6caf31

Please sign in to comment.