def applyUpdate()

in modules/core/src/main/scala/org/scalasteward/core/edit/EditAlg.scala [47:68]


  def applyUpdate(
      data: RepoData,
      update: Update.Single,
      preCommit: F[Unit] = F.unit
  ): F[List[EditAttempt]] =
    findUpdateReplacements(data.repo, data.config, update).flatMap {
      case Nil => logger.warn(s"Unable to bump version for update ${update.show}").as(Nil)
      case updateReplacements =>
        for {
          _ <- preCommit
          (preMigrations, postMigrations) = scalafixMigrationsFinder.findMigrations(update)
          preScalafixEdits <- runScalafixMigrations(data.repo, data.config, preMigrations)
          // PreUpdate migrations could invalidate previously found replacements,
          // so we find them again if the migrations produced any changes.
          freshReplacements <-
            if (preScalafixEdits.flatMap(_.commits).isEmpty) F.pure(updateReplacements)
            else findUpdateReplacements(data.repo, data.config, update)
          updateEdit <- applyUpdateReplacements(data, update, freshReplacements)
          postScalafixEdits <- runScalafixMigrations(data.repo, data.config, postMigrations)
          hooksEdits <- hookExecutor.execPostUpdateHooks(data, update)
        } yield preScalafixEdits ++ updateEdit ++ postScalafixEdits ++ hooksEdits
    }