Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scalafmt-core to 3.0.0 #192

Merged
merged 3 commits into from
Aug 20, 2021
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 .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=2.7.5
version=3.0.0
style = defaultWithAlign
maxColumn = 100

Expand All @@ -15,7 +15,7 @@ align {
openParenDefnSite = false
}

docstrings = JavaDoc
docstrings.style = Asterisk

rewrite {
rules = [SortImports, RedundantBraces]
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ThisBuild / scalaVersion := "2.12.12"
ThisBuild / organization := "io.higherkindness"
ThisBuild / scalaVersion := "2.12.12"
ThisBuild / organization := "io.higherkindness"
ThisBuild / githubOrganization := "47deg"

publish / skip := true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class FileInputParser {
case UNION => schema.getTypes.asScala.toList
case RECORD => List(schema)
case ENUM => List(schema)
case _ => sys.error("""Neither a record, enum nor a union of either.
case _ => sys.error("""Neither a record, enum nor a union of either.
|Nothing to map to a definition.""".trim.stripMargin)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ import scala.annotation.tailrec
import scala.io.Source

/**
* Adapted from `avrohugger.filesorter.AvdlFileSorter`.
* Changes:
* - Handles imported files not present in the input set
* - Doesn't require input files to be in canonical form (but returns them as such)
* - Errors out on unresolved imports instead of going into an infinite loop
* Adapted from `avrohugger.filesorter.AvdlFileSorter`. Changes:
* - Handles imported files not present in the input set
* - Doesn't require input files to be in canonical form (but returns them as such)
* - Errors out on unresolved imports instead of going into an infinite loop
*/
object AvdlFileSorter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import org.apache.avro.Protocol
import cats.implicits._
import higherkindness.droste.data.Mu
import higherkindness.skeuomorph.avro.{AvroF, Protocol => AvroProtocol}
import higherkindness.skeuomorph.mu.{CompressionType, MuF, codegen, Protocol => MuProtocol}
import higherkindness.skeuomorph.mu.{codegen, CompressionType, MuF, Protocol => MuProtocol}

import scala.meta._
import scala.util.Try
Expand Down Expand Up @@ -102,8 +102,8 @@ object AvroSrcGenerator {
private def getPath(p: AvroProtocol[Mu[AvroF]]): Path = {
val pathParts: NonEmptyList[String] =
NonEmptyList // Non empty list for a later safe `head` call
.one( // Start with reverse path of file name, the only part we know is for sure a thing
s"${p.name}${ScalaFileExtension}"
.one( // Start with reverse path of file name, the only part we know is for sure a thing
s"${p.name}$ScalaFileExtension"
)
.concat(
p.namespace // and maybe a path prefix from the namespace for the rest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ final case class LegacyAvroSrcGenerator(
private def getPath(p: Protocol): Path = {
val pathParts: NonEmptyList[String] =
NonEmptyList // Non empty list for a later safe `head` call
.one( // Start with reverse path of file name, the only part we know is for sure a thing
.one( // Start with reverse path of file name, the only part we know is for sure a thing
s"${p.getName}$ScalaFileExtension"
)
.concat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ trait CompendiumClient[F[_]] {
/**
* Retrieve a Protocol by its id
*
* @param identifier the protocol identifier
* @param version optional protocol version number
* @return a protocol
* @param identifier
* the protocol identifier
* @param version
* optional protocol version number
* @return
* a protocol
*/
def retrieveProtocol(identifier: String, version: Option[Int]): F[Option[RawProtocol]]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ trait AstOptics {
}

/**
* There are so many quirks for getting parameters for other
* constructs such as normal classes. I think we only need case
* classes and defs... we'll see :)
* There are so many quirks for getting parameters for other constructs such as normal classes. I
* think we only need case classes and defs... we'll see :)
*/
val params: Optional[Tree, List[ValDef]] = Optional[Tree, List[ValDef]] {
case ast._CaseClassDef(m) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import java.io.File
import cats.effect.{ContextShift, IO => IOCats}
import higherkindness.mu.rpc.srcgen.Model.ExecutionMode._
import sbt.Keys._
import sbt.{Def, settingKey, _}
import sbt.{settingKey, Def, _}
import sbt.io.{Path, PathFinder}
import higherkindness.mu.rpc.srcgen.Model._
import higherkindness.mu.rpc.srcgen.compendium.{CompendiumMode, HttpConfig, ProtocolAndVersion}
Expand Down Expand Up @@ -140,10 +140,10 @@ object SrcGenPlugin extends AutoPlugin {
}
},
muSrcGenSerializationType := SerializationType.Avro,
muSrcGenJarNames := Seq.empty,
muSrcGenSourceDirs := Seq((Compile / resourceDirectory).value),
muSrcGenJarNames := Seq.empty,
muSrcGenSourceDirs := Seq((Compile / resourceDirectory).value),
muSrcGenIdlTargetDir := (Compile / resourceManaged).value / muSrcGenIdlType.value.toString.toLowerCase,
muSrcGenTargetDir := (Compile / sourceManaged).value,
muSrcGenTargetDir := (Compile / sourceManaged).value,
muSrcGenBigDecimal := ScalaBigDecimalTaggedGen,
muSrcGenMarshallerImports := {
muSrcGenSerializationType.value match {
Expand All @@ -159,14 +159,14 @@ object SrcGenPlugin extends AutoPlugin {
Nil
}
},
muSrcGenCompressionType := NoCompressionGen,
muSrcGenIdiomaticEndpoints := true,
muSrcGenOpenApiHttpImpl := HttpImpl.Http4sV20,
muSrcGenStreamingImplementation := Fs2Stream,
muSrcGenExecutionMode := Local,
muSrcGenCompressionType := NoCompressionGen,
muSrcGenIdiomaticEndpoints := true,
muSrcGenOpenApiHttpImpl := HttpImpl.Http4sV20,
muSrcGenStreamingImplementation := Fs2Stream,
muSrcGenExecutionMode := Local,
muSrcGenCompendiumProtocolIdentifiers := Nil,
muSrcGenCompendiumServerUrl := "http://localhost:8080",
muSrcGenAvroGeneratorType := SkeumorphGen
muSrcGenCompendiumServerUrl := "http://localhost:8080",
muSrcGenAvroGeneratorType := SkeumorphGen
)

lazy val taskSettings: Seq[Def.Setting[_]] = {
Expand Down