Skip to content

Commit 4862721

Browse files
committed
👌review
1 parent 598d628 commit 4862721

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sbt-plugin/src/main/scala/ch/epfl/scala/AnalyzeDependencyGraph.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,20 @@ object AnalyzeDependencyGraph {
5252
}
5353
}.failOnException
5454

55-
private def analyzeDependencies(state: State, params: AnalysisParams): State =
56-
(for {
55+
private def analyzeDependencies(state: State, params: AnalysisParams): State = {
56+
for {
5757
repo <- params.repository.orElse(getGitHubRepo)
5858
vulnerabilities <- downloadAlerts(state, repo) match {
5959
case Success(v) => Some(v)
6060
case Failure(e) =>
6161
state.log.error(s"Failed to download alerts: ${e.getMessage}")
6262
None
6363
}
64-
} yield analyzeCves(state, vulnerabilities)).getOrElse(state)
64+
} yield analyzeCves(state, vulnerabilities)
65+
state
66+
}
6567

66-
private def analyzeCves(state: State, vulnerabilities: Seq[Vulnerability]): State = {
68+
private def analyzeCves(state: State, vulnerabilities: Seq[Vulnerability]): Unit = {
6769
val artifacts = getAllArtifacts(state)
6870
vulnerabilities.foreach { v =>
6971
val (goodMatches, badMatches) = vulnerabilityMatchesArtifacts(v, artifacts)
@@ -75,7 +77,6 @@ object AnalyzeDependencyGraph {
7577
println(" 🎉 no match (dependency was probably removed)")
7678
}
7779
}
78-
state
7980
}
8081

8182
private def getStateOrWarn[T](state: State, key: AttributeKey[T], what: String, command: String): Option[T] =

sbt-plugin/src/main/scala/ch/epfl/scala/GithubDependencyGraphPlugin.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ object GithubDependencyGraphPlugin extends AutoPlugin {
3232
val githubManifestsKey: AttributeKey[Map[String, githubapi.Manifest]] = AttributeKey("githubDependencyManifests")
3333
val githubProjectsKey: AttributeKey[Seq[ProjectRef]] = AttributeKey("githubProjectRefs")
3434
val githubSnapshotFileKey: AttributeKey[File] = AttributeKey("githubSnapshotFile")
35-
val githubAlertsKey: AttributeKey[Seq[AnalyzeDependencyGraph.Vulnerability]] = AttributeKey("githubAlerts")
3635

3736
val githubDependencyManifest: TaskKey[Option[githubapi.Manifest]] = taskKey(
3837
"The dependency manifest of the project"

0 commit comments

Comments
 (0)