Skip to content

Commit

Permalink
chore: Avoid partial function in groupBy (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippus authored Oct 24, 2024
1 parent 9f740dd commit 60367bb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ object AkkaVersionCheckPlugin extends AutoPlugin {
def checkModuleVersions(updateReport: UpdateReport, log: Logger): AkkaVersionReport = {
log.debug("Checking Akka module versions")
val allModules = updateReport.allModules
val grouped = allModules.groupBy(m =>
if (m.organization == "com.typesafe.akka" || m.organization.startsWith("com.lightbend.akka")) {
val grouped = allModules
.filter(m => m.organization == "com.typesafe.akka" || m.organization.startsWith("com.lightbend.akka"))
.groupBy{m =>
val nameWithoutScalaV = m.name.replaceFirst("(_2\\.\\d\\d|_3)$", "")
if (coreModules(nameWithoutScalaV)) Akka
else if (akkaHttpModules(nameWithoutScalaV)) AkkaHttp
else if (akkaManagementModules(nameWithoutScalaV)) AkkaManagement
else Others
}
)
val akkaVersion = grouped.get(Akka)
.flatMap(verifyVersions("Akka", _, updateReport))
.map(VersionNumber.apply)
Expand Down

0 comments on commit 60367bb

Please sign in to comment.