Skip to content

Update scalafmt-core to 3.0.8 #519

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.0.1"
version = "3.0.8"
maxColumn = 100
continuationIndent.defnSite = 2
assumeStandardLibraryStripMargin = true
Expand Down
6 changes: 3 additions & 3 deletions javaTimeCirceCodecs/src/main/scala/TimeCirceSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import io.circe.{Encoder, Json}

trait TimeCirceSupport {
private[this] val dateTimeFormatterBuilder = new DateTimeFormatterBuilder
//Always have 3 fractional digits
//.appendInstant converts to a data-time with a zone-offset of UTC formatted as ISO-8601
// Always have 3 fractional digits
// .appendInstant converts to a data-time with a zone-offset of UTC formatted as ISO-8601
private[this] val dateTimeFormatter = dateTimeFormatterBuilder.appendInstant(3).toFormatter

//overrides default circe encoder/decoder
// overrides default circe encoder/decoder
implicit val encodeOffsetDateTimeWIth3Millis: Encoder[OffsetDateTime] =
Encoder.encodeOffsetDateTimeWithFormatter(dateTimeFormatter)

Expand Down
2 changes: 1 addition & 1 deletion mailo/src/main/scala/mailo/data/FSMailData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FSMailData(directory: File, loadPartials: Boolean) extends MailData {
template.map(content => (file.getName, content))
})
.flatMap(_.toOption)
.toMap, //convert all tries to an option, remove none and create a map with the remainings
.toMap, // convert all tries to an option, remove none and create a map with the remainings
),
).toOption
.flatten
Expand Down
4 changes: 2 additions & 2 deletions mailo/src/main/scala/mailo/data/S3MailData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class S3MailData(implicit
for {
template <- getObject(name)
partials <- getObjects(s3Config.partialsFolder)
//filtering partial objects dropping initial chars
// filtering partial objects dropping initial chars
partialObjects <- {
val result: EitherMailError[Map[String, String]] = (partials
.map(n => n.drop(folder.length + 1) -> getObject(n))
Expand All @@ -59,7 +59,7 @@ class S3MailData(implicit
} yield (MailRawContent(template, partialObjects))
}

//http://stackoverflow.com/questions/309424/read-convert-an-inputstream-to-a-string
// http://stackoverflow.com/questions/309424/read-convert-an-inputstream-to-a-string
private[this] def convertStreamToString(is: java.io.InputStream): String = {
val s: java.util.Scanner = new java.util.Scanner(is).useDelimiter("\\A")
if (s.hasNext()) s.next() else ""
Expand Down
4 changes: 2 additions & 2 deletions mailo/src/main/scala/mailo/http/SMTPClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SMTPClient(implicit conf: Config = ConfigFactory.load())
Future.successful(Left(UnknownError(exception.getMessage)))
}

//attachments - tags guard
// attachments - tags guard
private[this] def internalSend(
message: MimeMessage,
attachments: List[Attachment],
Expand Down Expand Up @@ -91,7 +91,7 @@ class SMTPClient(implicit conf: Config = ConfigFactory.load())
Either[MailError, MailResponse],
] = {
val recipients = to + cc.map(a => s"; $a").getOrElse("")
//handling addresses parsing like mailo wants it
// handling addresses parsing like mailo wants it
(for {
from <- Try(new InternetAddress(from))
} yield send(from, recipients, subject, content, attachments, tags, headers)).getOrElse(
Expand Down
4 changes: 2 additions & 2 deletions mailo/src/test/scala/mailo/PersistenceSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MockedClient(val state: ConcurrentLinkedQueue[SimpleMail]) extends MailCli
headers: Map[String, String],
)(implicit executionContext: ExecutionContext): Future[Either[MailError, MailResponse]] =
Future.successful {
//State needs to be updated by one at the time
// State needs to be updated by one at the time
state.add(SimpleMail(subject))
Right(MailResponse(subject, "ok"))
}
Expand Down Expand Up @@ -67,7 +67,7 @@ class MockedClientWithDelay(val state: ConcurrentLinkedQueue[SimpleMail]) extend
headers: Map[String, String],
)(implicit executionContext: ExecutionContext): Future[Either[MailError, MailResponse]] =
Future.successful {
//State needs to be updated by one at the time
// State needs to be updated by one at the time
Thread.sleep(200)
state.add(SimpleMail(subject))
Right(MailResponse(subject, "ok"))
Expand Down
4 changes: 2 additions & 2 deletions tapiro/core/src/main/scala/io/buildo/tapiro/Util.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class Util() {
case Some(nonEmptyPackage) =>
val config = Config(Set.empty)
val models = Metarpheus.run(modelsPaths, config).models
//this is needed because Metarpheus removes auth from params when authentication type is "Auth"
//see https://github.com/buildo/retro/blob/dfe62fa54d4f34c1861d694ac0cd8fa82f0a8703/metarpheus/core/src/main/scala/io.buildo.metarpheus/core/extractors/controller.scala#L35
// this is needed because Metarpheus removes auth from params when authentication type is "Auth"
// see https://github.com/buildo/retro/blob/dfe62fa54d4f34c1861d694ac0cd8fa82f0a8703/metarpheus/core/src/main/scala/io.buildo.metarpheus/core/extractors/controller.scala#L35
val routesWithAuthParams: List[Route] = Metarpheus
.run(routesPaths, config)
.routes
Expand Down
4 changes: 2 additions & 2 deletions wiro/clientAkkaHttp/src/main/scala/RequestBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class RequestBuilder(
) {
def build(path: Seq[String], args: Map[String, Json]): HttpRequest = {
val completePath = path.mkString(".")
//we're trying to match here the paths generated by two different macros
//if it fails at runtime it means something is wrong in the implementation
// we're trying to match here the paths generated by two different macros
// if it fails at runtime it means something is wrong in the implementation
val methodMetaData = ctx.methodsMetaData
.getOrElse(
completePath,
Expand Down
2 changes: 1 addition & 1 deletion wiro/core/src/main/scala/OptionDecoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trait CustomOptionDecoder {
else
d(c) match {
case Right(a) => Right(Some(a))
//removed part of the code here
// removed part of the code here
case Left(df) => Left(df)
}
case c: FailedCursor =>
Expand Down
6 changes: 3 additions & 3 deletions wiro/serverAkkaHttp/src/main/scala/RPCRouter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ trait Router extends RPCServer with PathMacro with MetaDataMacro with LazyLoggin
}

def exceptionHandler = ExceptionHandler { case e: FailException[_] =>
//logging left
// logging left
e.response.entity match {
case HttpEntity.Strict(_, data) =>
logger.error(s"${e.response.status.value} ${data.utf8String}")
Expand Down Expand Up @@ -97,7 +97,7 @@ trait Router extends RPCServer with PathMacro with MetaDataMacro with LazyLoggin
logger.debug(s"client ip: ${ip}")
}

//Generates GET requests
// Generates GET requests
private[this] def query(operationFullName: String, methodMetaData: MethodMetaData): Route =
loggingClientIP {
(routePathPrefix(operationFullName, methodMetaData) & pathEnd & get & parameterMap) {
Expand All @@ -113,7 +113,7 @@ trait Router extends RPCServer with PathMacro with MetaDataMacro with LazyLoggin
extract(_.request.headers)
.map(_.map(header => header.name -> Json.fromString(header.value)).toMap)

//Generates POST requests
// Generates POST requests
private[this] def command(operationFullName: String, methodMetaData: MethodMetaData): Route =
loggingClientIP {
(routePathPrefix(operationFullName, methodMetaData) & pathEnd & post & entity(
Expand Down
6 changes: 3 additions & 3 deletions wiro/serverAkkaHttp/src/main/scala/RouterDerivation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ trait RouterDerivationModule extends PathMacro with MetaDataMacro with TypePathM
}

object RouterDerivationMacro extends RouterDerivationModule {
//val is required to make universe public
// val is required to make universe public
object MacroHelper {
//check only annotations of path type
//Since universe is public Tree type can be returned
// check only annotations of path type
// Since universe is public Tree type can be returned
def derivePath(c: Context)(tpe: c.Type): c.Tree = {
import c.universe._
tpe.typeSymbol.annotations.collectFirst {
Expand Down
2 changes: 1 addition & 1 deletion wiro/serverAkkaHttp/src/test/scala/TestController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ object TestController extends RouterDerivationModule {
)
}

//controllers interface and implementation
// controllers interface and implementation
@path("user")
trait UserController {
@query
Expand Down