private def findUpdatesNeedingAttention()

in modules/core/src/main/scala/org/scalasteward/core/update/PruningAlg.scala [48:76]


  private def findUpdatesNeedingAttention(
      data: RepoData,
      dependencies: List[Scope.Dependency]
  ): F[Option[Nel[WithUpdate]]] = {
    val repo = data.repo
    val repoCache = data.cache
    val repoConfig = data.config
    val depsWithoutResolvers = dependencies.map(_.value).distinct
    for {
      _ <- logger.info(s"Find updates for ${repo.show}")
      updates0 <- updateAlg
        .findUpdates(dependencies, repoConfig, None)
        .map(removeOvertakingUpdates(depsWithoutResolvers, _))
      updateStates0 <- findAllUpdateStates(repo, repoCache, depsWithoutResolvers, updates0)
      outdatedDeps = collectOutdatedDependencies(updateStates0)
      res <- {
        if (outdatedDeps.isEmpty) F.pure((updateStates0, updates0))
        else
          for {
            freshUpdates <- ensureFreshUpdates(repoConfig, dependencies, outdatedDeps, updates0)
              .map(removeOvertakingUpdates(depsWithoutResolvers, _))
            freshStates <- findAllUpdateStates(repo, repoCache, depsWithoutResolvers, freshUpdates)
          } yield (freshStates, freshUpdates)
      }
      (updateStates1, updates1) = res
      _ <- logger.info(util.logger.showUpdates(updates1.widen[Update.Single]))
      result <- filterUpdateStates(repo, repoConfig, updateStates1)
    } yield result
  }