Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2.1

orbs:
codacy: codacy/base@12.2.0
codacy_plugins_test: codacy/plugins-test@1.1.1
codacy: codacy/base@13.1.1
codacy_plugins_test: codacy/plugins-test@2.1.2

workflows:
version: 2
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ val dockerUser = "docker"

daemonUser in Docker := dockerUser

dockerBaseImage := "amazoncorretto:8-alpine3.14-jre"
dockerBaseImage := "amazoncorretto:8-alpine3.24-jre"

dockerCommands := dockerCommands.value.flatMap {
case cmd @ Cmd("ADD", _) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ case object Custom_Scala_LowerCasePatternMatching extends Pattern {
}

private[this] def isOffender(tree: Tree, pat: Pat) = {
!hasDeclaredType(pat) && !isCaseFromCollect(tree) && !isCaseFromPartialFunction(tree) && isLowerCase(pat)
!hasDeclaredType(pat) &&
!isCaseFromCollect(tree) &&
!isCaseFromPartialFunction(tree) &&
!isCaseFromCatch(tree) &&
isLowerCase(pat)
}

private[this] def isPartialApplication(tpe: Term.Name) = tpe.toString match {
case "orElse" | "andThen" => true
case "orElse" | "andThen" | "recover" | "recoverWith" => true
case _ => false
}

Expand Down Expand Up @@ -55,5 +59,12 @@ case object Custom_Scala_LowerCasePatternMatching extends Pattern {
pat.collect { case t @ p"$expr: $tpe" => t }.nonEmpty
}

private[this] def isCaseFromCatch(tree: Tree): Boolean = {
tree.parent.exists {
case t: Term.Try => t.catchp.exists(_ == tree)
case _ => false
}
}

private[this] def message(tree: Tree) = Message("Lower case pattern matching.")
}
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object Dependencies {
val scalaV = "2.12.20"

val betterFiles = "com.github.pathikrit" %% "better-files" % "3.8.0"
val codacyEngine = "com.codacy" %% "codacy-engine-scala-seed" % "5.0.2"
val codacyEngine = "com.codacy" %% "codacy-engine-scala-seed" % "6.1.4"
val scalaReflect = "org.scala-lang" % "scala-reflect" % scalaV

}