Skip to content

Commit

Permalink
Move imports to new syntax + change cats imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Apr 11, 2024
1 parent 606c987 commit 4d7966c
Show file tree
Hide file tree
Showing 91 changed files with 244 additions and 242 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inThisBuild(
)
)

import scala.sys.process._
import scala.sys.process.*

def crossPlugin(
x: sbt.librarymanagement.ModuleID
Expand Down
2 changes: 1 addition & 1 deletion modules/ast/src/main/scala/playground/smithyql/AST.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import cats.Functor
import cats.Id
import cats.Show
import cats.data.NonEmptyList
import cats.implicits._
import cats.kernel.Eq
import cats.kernel.Order
import cats.syntax.all.*
import cats.~>

/** The main type for AST nodes of SmithyQL. The type parameter `F[_]` is a type constructor that
Expand Down
2 changes: 1 addition & 1 deletion modules/ast/src/main/scala/playground/smithyql/DSL.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package playground.smithyql

import cats.Id
import cats.implicits._
import cats.syntax.all.*

object DSL {

Expand Down
4 changes: 2 additions & 2 deletions modules/ast/src/test/scala/playground/Assertions.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package playground

import cats.Id
import cats.implicits._
import cats.syntax.all.*
import com.softwaremill.diffx.Diff
import com.softwaremill.diffx.ShowConfig
import playground.smithyql._
import playground.smithyql.*
import weaver.Expectations
import weaver.SourceLocation

Expand Down
7 changes: 4 additions & 3 deletions modules/core/src/main/scala/playground/CompilationError.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package playground
import cats.Id
import cats.data.IorNel
import cats.data.NonEmptyList
import cats.implicits._
import cats.kernel.Eq
import playground.CompilationErrorDetails._
import playground.smithyql._
import cats.kernel.Order.catsKernelOrderingForOrder
import cats.syntax.all.*
import playground.CompilationErrorDetails.*
import playground.smithyql.*
import playground.smithyql.format.Formatter
import smithy.api.TimestampFormat
import smithy4s.ShapeId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package playground

import cats.MonadThrow
import cats.implicits._
import cats.syntax.all.*
import smithy4s.Document
import smithy4s.Endpoint
import smithy4s.Service
import smithy4s.kinds._
import smithy4s.kinds.*
import smithy4s.schema.Schema

class DynamicServiceProxy[Alg[_[_, _, _, _, _]], Op[_, _, _, _, _]](
Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/main/scala/playground/FileCompiler.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package playground

import cats.Parallel
import cats.implicits._
import cats.syntax.all.*
import cats.~>
import playground._
import playground.*
import playground.smithyql.SourceFile
import playground.smithyql.WithSource

Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/main/scala/playground/FileRunner.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package playground

import cats.data.NonEmptyList
import cats.implicits._
import playground._
import cats.syntax.all.*
import playground.*
import playground.smithyql.SourceFile
import playground.smithyql.SourceRange
import playground.smithyql.WithSource
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/main/scala/playground/IorUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import cats.data.Ior
import cats.data.Ior.Both
import cats.data.Ior.Left
import cats.data.Ior.Right
import cats.implicits._
import cats.kernel.Semigroup
import cats.syntax.all.*

object IorUtils {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package playground

import cats.data.EitherNel
import cats.implicits._
import cats.syntax.all.*
import playground.smithyql.OperationName
import playground.smithyql.QualifiedIdentifier
import playground.smithyql.QueryOperationName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package playground

import cats.Contravariant
import cats.Id
import cats.implicits._
import cats.syntax.all.*
import playground.smithyql.Binding
import playground.smithyql.BooleanLiteral
import playground.smithyql.Identifier
Expand Down Expand Up @@ -35,7 +35,7 @@ import smithy4s.schema.EnumTag
import smithy4s.schema.EnumValue
import smithy4s.schema.Field
import smithy4s.schema.Primitive
import smithy4s.schema.Primitive._
import smithy4s.schema.Primitive.*
import smithy4s.schema.Schema
import smithy4s.schema.SchemaVisitor

Expand Down
10 changes: 5 additions & 5 deletions modules/core/src/main/scala/playground/OperationCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import cats.data.Ior
import cats.data.IorNel
import cats.data.Kleisli
import cats.data.NonEmptyList
import cats.implicits._
import cats.syntax.all.*
import cats.~>
import playground._
import playground.*
import playground.smithyql.Prelude
import playground.smithyql.QualifiedIdentifier
import playground.smithyql.Query
Expand All @@ -16,9 +16,9 @@ import smithy.api
import smithy4s.Endpoint
import smithy4s.Service
import smithy4s.dynamic.DynamicSchemaIndex
import smithyql.syntax._
import types._
import util.chaining._
import smithyql.syntax.*
import types.*
import util.chaining.*

trait CompiledInput {
type _Op[_, _, _, _, _]
Expand Down
10 changes: 5 additions & 5 deletions modules/core/src/main/scala/playground/OperationRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import cats.data.NonEmptyList
import cats.effect.Async
import cats.effect.MonadCancelThrow
import cats.effect.Resource
import cats.effect.implicits._
import cats.effect.implicits.*
import cats.effect.std
import cats.implicits._
import cats.syntax.all.*
import fs2.compression.Compression
import org.http4s.Uri
import org.http4s.client.Client
import playground._
import playground.*
import playground.plugins.PlaygroundPlugin
import playground.plugins.SimpleHttpBuilder
import playground.smithyql.InputNode
Expand All @@ -36,9 +36,9 @@ import smithy4s.aws.AwsClient
import smithy4s.aws.AwsEnvironment
import smithy4s.dynamic.DynamicSchemaIndex
import smithy4s.http4s.SimpleRestJsonBuilder
import smithy4s.kinds._
import smithy4s.kinds.*
import smithy4s.schema.Schema
import smithyql.syntax._
import smithyql.syntax.*

trait OperationRunner[F[_]] {

Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/main/scala/playground/PlaygroundConfig.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package playground

import cats.implicits._
import cats.kernel.Eq
import cats.syntax.all.*
import com.github.plokhotnyuk.jsoniter_scala.core.JsonValueCodec
import com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker

Expand Down Expand Up @@ -73,7 +73,7 @@ object PlaygroundConfig {

}

import com.github.plokhotnyuk.jsoniter_scala.core._
import com.github.plokhotnyuk.jsoniter_scala.core.*

val decode: Array[Byte] => Either[Throwable, PlaygroundConfig] =
bytes =>
Expand Down
6 changes: 3 additions & 3 deletions modules/core/src/main/scala/playground/PreludeCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package playground
import cats.Applicative
import cats.Parallel
import cats.data.NonEmptyList
import cats.implicits._
import cats.mtl.Chronicle
import cats.mtl.implicits._
import playground._
import cats.mtl.implicits.*
import cats.syntax.all.*
import playground.*
import playground.smithyql.Prelude
import playground.smithyql.WithSource

Expand Down
6 changes: 3 additions & 3 deletions modules/core/src/main/scala/playground/QueryCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package playground
import cats.Apply
import cats.data.IorNec
import cats.data.NonEmptyChain
import cats.implicits._
import playground.CompilationErrorDetails._
import playground.smithyql._
import cats.syntax.all.*
import playground.CompilationErrorDetails.*
import playground.smithyql.*

import QueryCompiler.WAST

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import cats.Id
import cats.data.Ior
import cats.data.NonEmptyChain
import cats.data.NonEmptyList
import cats.implicits._
import playground.CompilationErrorDetails._
import playground.smithyql._
import playground.smithyutil._
import cats.syntax.all.*
import playground.CompilationErrorDetails.*
import playground.smithyql.*
import playground.smithyutil.*
import smithy.api
import smithy.api.TimestampFormat
import smithy4s.Bijection
Expand Down Expand Up @@ -45,8 +45,8 @@ import smithy4s.schema.Primitive.PUUID
import smithy4s.schema.Schema
import smithy4s.schema.SchemaVisitor
import smithy4s.~>
import types._
import util.chaining._
import types.*
import util.chaining.*

import java.util.Base64
import java.util.UUID
Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/main/scala/playground/ServiceIndex.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package playground

import cats.Id
import cats.implicits._
import cats.syntax.all.*
import playground.smithyql.OperationName
import playground.smithyql.QualifiedIdentifier
import smithy.api
import smithy4s.dynamic.DynamicSchemaIndex
import smithyql.syntax._
import smithyql.syntax.*

// Abstraction for service metadata. Can be used by multi-service compilers/runners/completion providers etc.
trait ServiceIndex {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package playground
import aws.api
import playground.smithyql.QualifiedIdentifier
import smithy4s.Service
import smithyql.syntax._
import smithyql.syntax.*

object ServiceNameExtractor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package playground.smithyql

import cats.data.Chain
import cats.data.Chain.==:
import cats.implicits._
import cats.syntax.all.*

// The path to a position in the parsed source
sealed trait NodeContext extends Product with Serializable with NodeContext.PathEntry.TraversalOps {

def render: String =
this match {
case NodeContext.Impl(context) =>
import NodeContext.PathEntry._
import NodeContext.PathEntry.*

context
.map {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package playground.smithyql

import cats.implicits._
import cats.syntax.all.*

trait RangeIndex {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package playground.smithyql

import cats.implicits._
import cats.syntax.all.*
import playground.ServiceNameExtractor
import smithy4s.Service
import smithy4s.ShapeId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package playground.smithyutil

import cats.implicits._
import cats.syntax.all.*
import smithy.api
import smithy4s.Refinement
import smithy4s.RefinementProvider
import smithy4s.Surjection
import smithy4s.schema.CollectionTag._
import smithy4s.schema.Primitive._
import smithy4s.schema.CollectionTag.*
import smithy4s.schema.Primitive.*
import smithy4s.schema.Schema
import smithy4s.schema.Schema._
import smithy4s.schema.Schema.*
import smithy4s.~>

/** Reifies refinement hints into the schema.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package playground.std

import cats.Functor
import cats.effect.std.UUIDGen
import cats.implicits._
import cats.syntax.all.*
import smithy4s.Timestamp

trait StdlibRuntime[F[_]] {
Expand Down
6 changes: 3 additions & 3 deletions modules/core/src/test/scala/playground/Diffs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import smithy4s.Blob
import scala.annotation.nowarn

object Diffs {
import com.softwaremill.diffx._
import com.softwaremill.diffx.cats._
import com.softwaremill.diffx.generic.auto._
import com.softwaremill.diffx.*
import com.softwaremill.diffx.cats.*
import com.softwaremill.diffx.generic.auto.*

implicit val diffNodeContext: Diff[NodeContext] = Diff.derivedDiff
implicit val diffContextRange: Diff[ContextRange] = Diff.derivedDiff
Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/test/scala/playground/IorUtilsTests.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package playground

import cats.data.Ior
import cats.implicits._
import weaver._
import cats.syntax.all.*
import weaver.*

object IorUtilsTests extends FunSuite {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package playground

import cats.Id
import cats.implicits._
import com.softwaremill.diffx.cats._
import playground.Diffs._
import playground.smithyql.Diffs._
import cats.syntax.all.*
import com.softwaremill.diffx.cats.*
import playground.Diffs.*
import playground.smithyql.Diffs.*
import playground.smithyql.OperationName
import playground.smithyql.Prelude
import playground.smithyql.QualifiedIdentifier
import playground.smithyql.QueryOperationName
import playground.smithyql.SourceRange
import playground.smithyql.StringRangeUtils._
import playground.smithyql.StringRangeUtils.*
import playground.smithyql.parser.SourceParser
import weaver._
import weaver.*

import Assertions._
import Assertions.*
import ServiceIndex.ServiceMetadata

object MultiServiceResolverTests extends FunSuite {
Expand Down
Loading

0 comments on commit 4d7966c

Please sign in to comment.