Skip to content

Commit

Permalink
Remove significant indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Feb 3, 2024
1 parent ff18c42 commit 6518f84
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
runner.dialect = "scala3"
version = 3.5.8
version = 3.7.17
runner.dialect = scala3
runner.dialectOverride.allowSignificantIndentation = false

maxColumn = 100
align.preset = some

Expand Down
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ val commonSettings = Seq(
) ++
compilerPlugins,
scalacOptions ++= Seq(
"-Wunused:all"
"-Wunused:all",
"-no-indent",
),
)

Expand Down
17 changes: 13 additions & 4 deletions core/src/main/scala/respectfully/API.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ trait API[Alg] {

object API {

def apply[Alg](using api: API[Alg]): API[Alg] = api
def apply[Alg](
using api: API[Alg]
): API[Alg] = api

inline def derived[Alg]: API[Alg] = ${ derivedImpl[Alg] }

private def derivedImpl[Alg: Type](using Quotes): Expr[API[Alg]] = {
private def derivedImpl[Alg: Type](
using Quotes
): Expr[API[Alg]] = {
import quotes.reflect.{TypeRepr, report, DefDef, Position, asTerm}

val algTpe = TypeRepr.of[Alg]
Expand Down Expand Up @@ -203,7 +207,11 @@ object API {
),
)

private def proxy[Trait: Type](using Quotes)(asf: Expr[AsFunction]) = {
private def proxy[Trait: Type](
using Quotes
)(
asf: Expr[AsFunction]
) = {
import quotes.reflect.*
val parents = List(TypeTree.of[Object], TypeTree.of[Trait])

Expand Down Expand Up @@ -317,7 +325,7 @@ object API {
}

override val toRoutes: Alg => HttpApp[IO] =
impl =>
impl => {
val implFunction = asFunction(impl)

HttpApp { req =>
Expand All @@ -340,6 +348,7 @@ object API {
}
.map(Response[IO]().withEntity(_))
}
}

}

Expand Down

0 comments on commit 6518f84

Please sign in to comment.