Update circe to 0.15.x

This commit is contained in:
eikek
2023-11-05 20:30:03 +01:00
parent d806a6a65e
commit 46faa7aa40
3 changed files with 14 additions and 15 deletions

View File

@ -10,8 +10,7 @@ val elmCompileMode = settingKey[ElmCompileMode]("How to compile elm sources")
val scalafixSettings = Seq( val scalafixSettings = Seq(
semanticdbEnabled := true, // enable SemanticDB semanticdbEnabled := true, // enable SemanticDB
semanticdbVersion := scalafixSemanticdb.revision, // "4.4.0" semanticdbVersion := scalafixSemanticdb.revision // "4.4.0"
ThisBuild / scalafixDependencies ++= Dependencies.organizeImports
) )
val sharedSettings = Seq( val sharedSettings = Seq(

View File

@ -19,7 +19,7 @@ import docspell.common.syntax.file._
import docspell.common.util.Zip import docspell.common.util.Zip
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder} import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder}
import io.circe.yaml.{parser => YamlParser} import io.circe.yaml.{Parser => YamlParser}
import io.circe.{Decoder, Encoder} import io.circe.{Decoder, Encoder}
import io.circe.{parser => JsonParser} import io.circe.{parser => JsonParser}
@ -161,7 +161,7 @@ object AddonMeta {
.rethrow .rethrow
def fromYamlString(str: String): Either[Throwable, AddonMeta] = def fromYamlString(str: String): Either[Throwable, AddonMeta] =
YamlParser.parse(str).flatMap(_.as[AddonMeta]) YamlParser.default.parse(str).flatMap(_.as[AddonMeta])
def fromYamlBytes[F[_]: Sync](bytes: Stream[F, Byte]): F[AddonMeta] = def fromYamlBytes[F[_]: Sync](bytes: Stream[F, Byte]): F[AddonMeta] =
bytes bytes
@ -171,12 +171,16 @@ object AddonMeta {
.map(fromYamlString) .map(fromYamlString)
.rethrow .rethrow
def fromYamlFile[F[_]: Sync](file: Path): F[AddonMeta] = def fromYamlFile[F[_]: Sync](file: Path): F[AddonMeta] = {
Sync[F] val reader: F[java.io.Reader] =
.blocking(YamlParser.parse(java.nio.file.Files.newBufferedReader(file.toNioPath))) Sync[F].blocking(java.nio.file.Files.newBufferedReader(file.toNioPath))
.rethrow reader
.map(_.as[AddonMeta]) .flatMap(r =>
Sync[F]
.blocking(YamlParser.default.decode[AddonMeta](r))
)
.rethrow .rethrow
}
def findInDirectory[F[_]: Sync: Files](dir: Path): F[AddonMeta] = { def findInDirectory[F[_]: Sync: Files](dir: Path): F[AddonMeta] = {
val logger = docspell.logging.getLogger[F] val logger = docspell.logging.getLogger[F]

View File

@ -12,9 +12,9 @@ object Dependencies {
val CatsVersion = "2.7.0" val CatsVersion = "2.7.0"
val CatsEffectVersion = "3.5.2" val CatsEffectVersion = "3.5.2"
val CatsParseVersion = "0.3.10" val CatsParseVersion = "0.3.10"
val CirceVersion = "0.14.6" val CirceVersion = "0.15.0-M1"
val CirceGenericExtrasVersion = "0.14.3" val CirceGenericExtrasVersion = "0.14.3"
val CirceYamlVersion = "0.14.2" val CirceYamlVersion = "0.15.1"
val ClipboardJsVersion = "2.0.11" val ClipboardJsVersion = "2.0.11"
val DoobieVersion = "1.0.0-RC2" val DoobieVersion = "1.0.0-RC2"
val EmilVersion = "0.13.0" val EmilVersion = "0.13.0"
@ -35,7 +35,6 @@ object Dependencies {
val MariaDbVersion = "3.2.0" val MariaDbVersion = "3.2.0"
val MUnitVersion = "0.7.29" val MUnitVersion = "0.7.29"
val MUnitCatsEffectVersion = "1.0.7" val MUnitCatsEffectVersion = "1.0.7"
val OrganizeImportsVersion = "0.6.0"
val PdfboxVersion = "2.0.29" val PdfboxVersion = "2.0.29"
val PdfjsViewerVersion = "2.12.313" val PdfjsViewerVersion = "2.12.313"
val PoiVersion = "4.1.2" val PoiVersion = "4.1.2"
@ -342,7 +341,4 @@ object Dependencies {
"com.ibm.icu" % "icu4j" % Icu4jVersion "com.ibm.icu" % "icu4j" % Icu4jVersion
) )
val organizeImports = Seq(
"com.github.liancheng" %% "organize-imports" % OrganizeImportsVersion
)
} }