Skip to content

Commit

Permalink
Update scalafmt-core to 3.8.3 (#508)
Browse files Browse the repository at this point in the history
* Update scalafmt-core to 3.8.3

* Reformat with scalafmt 3.8.3

Executed command: scalafmt --non-interactive

* Add 'Reformat with scalafmt 3.8.3' to .git-blame-ignore-revs
  • Loading branch information
scala-steward authored Aug 21, 2024
1 parent d5cf14a commit a32b97b
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Scala Steward: Reformat with scalafmt 3.6.0
49896fb5557f065fbd41afbd74085f49177aa3d4

# Scala Steward: Reformat with scalafmt 3.8.3
585dfcc18c2106ab35f69e495627a0bc5770caaa
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.6.1"
version = "3.8.3"
runner.dialect = scala213
maxColumn = 140
align.preset = some
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import cats.implicits._
import scala.concurrent.ExecutionContext
import cats.data.OptionT

final class MonixFutureCache[K, V](timeProvider: TimeProvider)(implicit ec: ExecutionContext) extends ExpiringCache[Future, K, V] {
final class MonixFutureCache[K, V](
timeProvider: TimeProvider
)(
implicit ec: ExecutionContext
) extends ExpiringCache[Future, K, V] {
private val ref: AtomicAny[Map[K, Entry[V]]] = AtomicAny(Map.empty[K, Entry[V]])

override def get(key: K): Future[Option[V]] =
Expand Down Expand Up @@ -41,6 +45,11 @@ final class MonixFutureCache[K, V](timeProvider: TimeProvider)(implicit ec: Exec
object MonixFutureCache {
final case class Entry[V](value: V, expirationTime: Instant)

def apply[K, V](timeProvider: TimeProvider = TimeProvider.default)(implicit ec: ExecutionContext): MonixFutureCache[K, V] =
def apply[K, V](
timeProvider: TimeProvider = TimeProvider.default
)(
implicit ec: ExecutionContext
): MonixFutureCache[K, V] =
new MonixFutureCache[K, V](timeProvider)

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import scala.concurrent.duration.FiniteDuration

trait CirceJsonDecoders {

implicit def jsonDecoder[A](implicit decoder: Decoder[A]): JsonDecoder[A] =
implicit def jsonDecoder[A](
implicit decoder: Decoder[A]
): JsonDecoder[A] =
(data: String) => io.circe.parser.decode[A](data).leftMap(error => JsonDecoder.Error(error.getMessage, cause = Some(error)))

implicit val optionScopeDecoder: Decoder[Option[Scope]] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ import scala.util.control.NonFatal

trait JsoniterJsonDecoders {

implicit def jsonDecoder[A](implicit jsonCodec: JsonValueCodec[A]): JsonDecoder[A] =
implicit def jsonDecoder[A](
implicit jsonCodec: JsonValueCodec[A]
): JsonDecoder[A] =
(data: String) =>
Try(readFromString[A](data)) match {
case Success(value) =>
Expand Down Expand Up @@ -123,10 +125,18 @@ trait JsoniterJsonDecoders {
implicit val refreshTokenResponseDecoder: JsonValueCodec[RefreshTokenResponse] =
JsonCodecMaker.make(CodecMakerConfig.withFieldNameMapper(JsonCodecMaker.enforce_snake_case))

private def customDecoderFromUnsafe[A](read: JsonReader => A)(implicit toNull: Null <:< A): JsonValueCodec[A] =
private def customDecoderFromUnsafe[A](
read: JsonReader => A
)(
implicit toNull: Null <:< A
): JsonValueCodec[A] =
customDecoderTry[A](reader => Try(read(reader)))

private def customDecoderTry[A](read: JsonReader => Try[A])(implicit toNull: Null <:< A): JsonValueCodec[A] =
private def customDecoderTry[A](
read: JsonReader => Try[A]
)(
implicit toNull: Null <:< A
): JsonValueCodec[A] =
customDecoderWithDefault[A](read)(toNull(null))

private def customDecoderWithDefault[A](read: JsonReader => Try[A])(default: A) = new JsonValueCodec[A] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ trait AuthorizationCodeProvider[UriType, F[_]] {

object AuthorizationCodeProvider {

def apply[U, F[_]](implicit ev: AuthorizationCodeProvider[U, F]): AuthorizationCodeProvider[U, F] = ev
def apply[U, F[_]](
implicit ev: AuthorizationCodeProvider[U, F]
): AuthorizationCodeProvider[U, F] = ev

/*
Structure describing endpoints configuration for selected oauth2 provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ trait PasswordGrantProvider[F[_]] {

object PasswordGrantProvider {

def apply[F[_]](implicit ev: PasswordGrantProvider[F]): PasswordGrantProvider[F] = ev
def apply[F[_]](
implicit ev: PasswordGrantProvider[F]
): PasswordGrantProvider[F] = ev

def apply[F[_]](
tokenUrl: Uri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ trait UserInfoProvider[F[_]] {
}

object UserInfoProvider {
def apply[F[_]](implicit ev: UserInfoProvider[F]): UserInfoProvider[F] = ev

def apply[F[_]](
implicit ev: UserInfoProvider[F]
): UserInfoProvider[F] = ev

private def requestUserInfo[F[_]](
baseUrl: Uri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ trait JsonDecoder[A] {
}

object JsonDecoder {
def apply[A](implicit ev: JsonDecoder[A]): JsonDecoder[A] = ev

def apply[A](
implicit ev: JsonDecoder[A]
): JsonDecoder[A] = ev

final case class Error(message: String, cause: Option[Throwable] = None) extends Exception(message, cause.orNull)

Expand Down

0 comments on commit a32b97b

Please sign in to comment.