Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacoby6000 committed Nov 14, 2018
1 parent 64e39aa commit ff24832
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scalafix-core/src/main/scala/scalafix/config/Regex.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ import java.util.regex.Pattern
import scalafix.internal.config.ScalafixMetaconfigReaders._

class Regex(
val pattern: Pattern,
val captureGroup: Option[Int]
val pattern: Pattern,
val captureGroup: Option[Int]
)

object Regex {
implicit val regexDecoder: ConfDecoder[Regex] =
ConfDecoder.instance[Regex] {
case obj: Conf.Obj =>
(obj.get[Pattern]("pattern") |@| obj.getOption[Int]("captureGroup")).map {
case (pattern, groupIndex) => new Regex(pattern, groupIndex)
}
(obj.get[Pattern]("pattern") |@| obj.getOption[Int]("captureGroup"))
.map {
case (pattern, groupIndex) => new Regex(pattern, groupIndex)
}
}

implicit val customMessageRegexDecoder: ConfDecoder[CustomMessage[Regex]] =
Expand Down

0 comments on commit ff24832

Please sign in to comment.