Skip to content
Permalink
Browse files

Removing unused imports

  • Loading branch information...
blast-hardcheese committed Apr 23, 2019
1 parent e6a25ae commit 4ef618d9ea9d213cd410e062313bd4252cc4e2fc
Showing with 28 additions and 133 deletions.
  1. +1 −0 build.sbt
  2. +0 −2 modules/codegen/src/main/scala/com/twilio/guardrail/Args.scala
  3. +0 −1 modules/codegen/src/main/scala/com/twilio/guardrail/CLI.scala
  4. +1 −4 modules/codegen/src/main/scala/com/twilio/guardrail/ClientGenerator.scala
  5. +2 −5 modules/codegen/src/main/scala/com/twilio/guardrail/Common.scala
  6. +1 −3 modules/codegen/src/main/scala/com/twilio/guardrail/ProtocolElems.scala
  7. +1 −1 modules/codegen/src/main/scala/com/twilio/guardrail/ProtocolGenerator.scala
  8. +0 −4 modules/codegen/src/main/scala/com/twilio/guardrail/ReadSwagger.scala
  9. +2 −7 modules/codegen/src/main/scala/com/twilio/guardrail/SwaggerUtil.scala
  10. +0 −1 modules/codegen/src/main/scala/com/twilio/guardrail/WriteTree.scala
  11. +0 −2 modules/codegen/src/main/scala/com/twilio/guardrail/core/CoreTermInterp.scala
  12. +0 −4 modules/codegen/src/main/scala/com/twilio/guardrail/generators/AkkaHttpClientGenerator.scala
  13. +0 −8 modules/codegen/src/main/scala/com/twilio/guardrail/generators/AkkaHttpGenerator.scala
  14. +2 −7 modules/codegen/src/main/scala/com/twilio/guardrail/generators/AkkaHttpServerGenerator.scala
  15. +1 −7 modules/codegen/src/main/scala/com/twilio/guardrail/generators/CirceProtocolGenerator.scala
  16. +0 −2 modules/codegen/src/main/scala/com/twilio/guardrail/generators/EndpointsClientGenerator.scala
  17. +0 −8 modules/codegen/src/main/scala/com/twilio/guardrail/generators/EndpointsGenerator.scala
  18. +0 −7 modules/codegen/src/main/scala/com/twilio/guardrail/generators/Http4sClientGenerator.scala
  19. +3 −13 modules/codegen/src/main/scala/com/twilio/guardrail/generators/Http4sHelper.scala
  20. +0 −1 modules/codegen/src/main/scala/com/twilio/guardrail/generators/Http4sServerGenerator.scala
  21. +0 −8 modules/codegen/src/main/scala/com/twilio/guardrail/generators/Java/DropwizardGenerator.scala
  22. +1 −1 modules/codegen/src/main/scala/com/twilio/guardrail/generators/Java/DropwizardServerGenerator.scala
  23. +1 −1 modules/codegen/src/main/scala/com/twilio/guardrail/generators/Java/JacksonGenerator.scala
  24. +0 −1 modules/codegen/src/main/scala/com/twilio/guardrail/generators/ScalaGenerator.scala
  25. +2 −10 modules/codegen/src/main/scala/com/twilio/guardrail/generators/ScalaParameter.scala
  26. +3 −3 modules/codegen/src/main/scala/com/twilio/guardrail/package.scala
  27. +0 −1 modules/codegen/src/main/scala/com/twilio/guardrail/protocol/terms/protocol/EnumProtocolTerm.scala
  28. +0 −1 modules/codegen/src/main/scala/com/twilio/guardrail/protocol/terms/protocol/ModelProtocolTerm.scala
  29. +0 −2 ...les/codegen/src/main/scala/com/twilio/guardrail/protocol/terms/protocol/ProtocolSupportTerm.scala
  30. +0 −2 ...es/codegen/src/main/scala/com/twilio/guardrail/protocol/terms/protocol/ProtocolSupportTerms.scala
  31. +1 −1 modules/codegen/src/main/scala/com/twilio/guardrail/protocol/terms/server/ServerTerm.scala
  32. +0 −2 modules/codegen/src/main/scala/com/twilio/guardrail/shims/package.scala
  33. +0 −1 modules/codegen/src/main/scala/com/twilio/guardrail/terms/CoreTerm.scala
  34. +5 −11 modules/codegen/src/main/scala/com/twilio/guardrail/terms/SwaggerTerm.scala
  35. +1 −1 modules/codegen/src/main/scala/com/twilio/guardrail/terms/SwaggerTerms.scala
@@ -156,6 +156,7 @@ val codegenSettings = Seq(
scalacOptions in ThisBuild ++= Seq(
"-Ypartial-unification",
"-Ydelambdafy:method",
"-Ywarn-unused-import",
"-feature",
"-unchecked",
"-deprecation",
@@ -1,7 +1,5 @@
package com.twilio.guardrail

import cats.syntax.either._

case class Args(
kind: CodegenTarget,
specPath: Option[String],
@@ -1,7 +1,6 @@
package com.twilio.guardrail

import java.nio.file.Path
import cats.Applicative
import cats.data.NonEmptyList
import cats.implicits._
import cats.~>
@@ -5,13 +5,10 @@ import cats.free.Free
import cats.implicits._
import com.twilio.guardrail.languages.LA
import com.twilio.guardrail.protocol.terms.client.ClientTerms
import com.twilio.guardrail.protocol.terms.{ Response, Responses }
import com.twilio.guardrail.protocol.terms.Responses
import com.twilio.guardrail.terms.framework.FrameworkTerms
import com.twilio.guardrail.terms.{ RouteMeta, ScalaTerms, SwaggerTerms }
import io.swagger.v3.oas.models.Operation
import io.swagger.v3.oas.models.media.Schema
import java.net.URI
import scala.collection.JavaConverters._

case class Clients[L <: LA](clients: List[Client[L]], supportDefinitions: List[SupportDefinition[L]])
case class Client[L <: LA](pkg: List[String],
@@ -4,19 +4,16 @@ import _root_.io.swagger.v3.oas.models.OpenAPI
import cats.data.NonEmptyList
import cats.free.Free
import cats.implicits._
import cats.{ Id, ~> }
import cats.Id
import com.twilio.guardrail.languages.LA
import com.twilio.guardrail.protocol.terms.protocol.{ ArrayProtocolTerms, EnumProtocolTerms, ModelProtocolTerms, PolyProtocolTerms, ProtocolSupportTerms }
import com.twilio.guardrail.terms.framework.FrameworkTerms
import com.twilio.guardrail.protocol.terms.client.ClientTerms
import com.twilio.guardrail.protocol.terms.server.ServerTerms
import com.twilio.guardrail.shims._
import com.twilio.guardrail.terms.{ CoreTerms, ScalaTerms, SwaggerTerms }
import java.nio.file.{ Path, Paths }
import java.util.Locale
import java.nio.file.Path
import scala.collection.JavaConverters._
import scala.io.AnsiColor
import scala.meta._
import java.net.URI

case class SupportDefinition[L <: LA](className: L#TermName, imports: List[L#Import], definition: L#ClassDefinition)
@@ -1,7 +1,6 @@
package com.twilio.guardrail

import cats.{ FlatMap, MonadError }
import cats.data.EitherT
import cats.FlatMap
import cats.free.Free
import cats.implicits._
import com.twilio.guardrail.languages.LA
@@ -38,7 +37,6 @@ object ProtocolElems {
P: ProtocolSupportTerms[L, F]): Free[F, List[StrictProtocolElems[L]]] = {
import Sc._
import Sw._
import P._
log.function(s"resolve(${elems.length} references)")(
FlatMap[Free[F, ?]]
.tailRecM[(Int, List[ProtocolElems[L]]), List[StrictProtocolElems[L]]]((limit, elems))({
@@ -11,7 +11,7 @@ import com.twilio.guardrail.terms.framework.FrameworkTerms
import com.twilio.guardrail.terms.{ ScalaTerms, SwaggerTerms }
import java.util.Locale
import scala.collection.JavaConverters._
import scala.language.{ existentials, higherKinds, postfixOps, reflectiveCalls }
import scala.language.higherKinds

case class ProtocolDefinitions[L <: LA](elems: List[StrictProtocolElems[L]],
protocolImports: List[L#Import],
@@ -3,14 +3,10 @@ package com.twilio.guardrail
import java.nio.file.Path
import java.util

import cats._
import cats.implicits._
import io.swagger.parser.OpenAPIParser
import io.swagger.v3.oas.models.OpenAPI
import io.swagger.v3.parser.core.models.ParseOptions

import scala.io.AnsiColor

case class ReadSwagger[T](path: Path, next: OpenAPI => T)
object ReadSwagger {
def readSwagger[T](rs: ReadSwagger[Target[T]]): Target[T] =
@@ -1,26 +1,21 @@
package com.twilio.guardrail

import cats.data.{ EitherT, NonEmptyList }
import cats.data.NonEmptyList
import io.swagger.v3.oas.models._
import io.swagger.v3.oas.models.PathItem._
import io.swagger.v3.oas.models.media._
import io.swagger.v3.oas.models.parameters._
import io.swagger.v3.oas.models.responses._
import cats.{ FlatMap, Foldable }
import cats.free.Free
import cats.implicits._
import com.github.javaparser.ast.NodeList
import com.github.javaparser.ast.expr._
import com.twilio.guardrail.terms.{ ScalaTerms, SwaggerTerms }
import com.twilio.guardrail.terms.framework.FrameworkTerms
import com.twilio.guardrail.extract.{ CustomTypeName, Default, VendorExtension }
import com.twilio.guardrail.extract.VendorExtension.VendorExtensible._
import com.twilio.guardrail.generators.ScalaParameter
import com.twilio.guardrail.languages.{ JavaLanguage, LA, ScalaLanguage }
import com.twilio.guardrail.languages.{ LA, ScalaLanguage }
import com.twilio.guardrail.protocol.terms.Responses
import com.twilio.guardrail.shims._
import java.util.{ Map => JMap }
import scala.language.reflectiveCalls
import scala.meta._
import com.twilio.guardrail.protocol.terms.protocol.PropMeta
import scala.collection.JavaConverters._
@@ -5,7 +5,6 @@ import cats.implicits._
import java.nio.charset.StandardCharsets.UTF_8
import java.nio.file.{ Files, Path, StandardOpenOption }
import scala.io.AnsiColor
import scala.meta._

case class WriteTree(path: Path, contents: Array[Byte])
object WriteTree {
@@ -7,8 +7,6 @@ import cats.{ FlatMap, ~> }
import com.twilio.guardrail.languages.LA
import com.twilio.guardrail.terms._
import java.nio.file.Paths
import scala.io.AnsiColor
import scala.meta._
import scala.util.control.NonFatal

case class CoreTermInterp[L <: LA](defaultFramework: String,
@@ -1,19 +1,15 @@
package com.twilio.guardrail
package generators

import java.util.Locale
import _root_.io.swagger.v3.oas.models._
import cats.arrow.FunctionK
import cats.data.NonEmptyList
import cats.syntax.flatMap._
import com.twilio.guardrail.generators.syntax.Scala._
import com.twilio.guardrail.generators.syntax._
import com.twilio.guardrail.protocol.terms.Responses
import com.twilio.guardrail.protocol.terms.client._
import com.twilio.guardrail.shims._
import com.twilio.guardrail.terms.RouteMeta
import com.twilio.guardrail.languages.ScalaLanguage
import scala.collection.JavaConverters._
import scala.meta._
import _root_.io.swagger.v3.oas.models.PathItem.HttpMethod
import java.net.URI
@@ -1,16 +1,8 @@
package com.twilio.guardrail
package generators

import io.swagger.v3.oas.models._
import cats.arrow.FunctionK
import cats.data.NonEmptyList
import cats.instances.all._
import cats.syntax.flatMap._
import cats.syntax.functor._
import cats.syntax.traverse._
import com.twilio.guardrail.terms.framework._
import java.util.Locale
import scala.collection.JavaConverters._
import scala.meta._
import com.twilio.guardrail.languages.ScalaLanguage

@@ -2,12 +2,8 @@ package com.twilio.guardrail
package generators

import cats.arrow.FunctionK
import cats.data.{ NonEmptyList, OptionT }
import cats.instances.all._
import cats.syntax.applicative._
import cats.syntax.flatMap._
import cats.syntax.functor._
import cats.syntax.traverse._
import cats.data.NonEmptyList
import cats.implicits._
import com.twilio.guardrail.SwaggerUtil
import com.twilio.guardrail.extract.{ ServerRawResponse, TracingLabel }
import com.twilio.guardrail.generators.syntax.Scala._
@@ -16,7 +12,6 @@ import com.twilio.guardrail.protocol.terms.Responses
import com.twilio.guardrail.protocol.terms.server._
import com.twilio.guardrail.terms.RouteMeta
import com.twilio.guardrail.shims._
import scala.collection.JavaConverters._
import scala.meta._
import _root_.io.swagger.v3.oas.models.PathItem.HttpMethod

@@ -4,21 +4,15 @@ package generators
import _root_.io.swagger.v3.oas.models.media._
import cats.implicits._
import cats.~>
import cats.data.NonEmptyList
import com.twilio.guardrail.extract.{ Default, EmptyValueIsNull }
import com.twilio.guardrail.generators.syntax.RichString
import com.twilio.guardrail.shims._
import com.twilio.guardrail.terms
import java.util.Locale
import com.twilio.guardrail.languages.{ LA, ScalaLanguage }
import com.twilio.guardrail.languages.ScalaLanguage
import com.twilio.guardrail.protocol.terms.protocol._
import scala.collection.JavaConverters._
import scala.meta._
import scala.language.existentials

object CirceProtocolGenerator {
import ProtocolGenerator._

def suffixClsName(prefix: String, clsName: String) = Pat.Var(Term.Name(s"${prefix}${clsName}"))

def lookupTypeName(tpeName: String, concreteTypes: List[PropMeta[ScalaLanguage]])(f: Type => Type): Option[Type] =
@@ -1,7 +1,6 @@
package com.twilio.guardrail
package generators

import java.util.Locale
import _root_.io.swagger.v3.oas.models.PathItem.HttpMethod
import cats.arrow.FunctionK
import cats.data.{ Ior, NonEmptyList }
@@ -14,7 +13,6 @@ import com.twilio.guardrail.protocol.terms.client._
import com.twilio.guardrail.terms.RouteMeta
import com.twilio.guardrail.shims._
import java.net.URI
import scala.collection.JavaConverters._
import scala.meta._

object EndpointsClientGenerator {
@@ -1,16 +1,8 @@
package com.twilio.guardrail
package generators

import io.swagger.models._
import cats.arrow.FunctionK
import cats.data.NonEmptyList
import cats.instances.all._
import cats.syntax.flatMap._
import cats.syntax.functor._
import cats.syntax.traverse._
import com.twilio.guardrail.terms.framework._
import java.util.Locale
import scala.collection.JavaConverters._
import scala.meta._
import com.twilio.guardrail.languages.ScalaLanguage

@@ -1,22 +1,15 @@
package com.twilio.guardrail
package generators

import _root_.io.swagger.v3.oas.models._
import cats.arrow.FunctionK
import cats.data.NonEmptyList
import cats.instances.all._
import cats.syntax.flatMap._
import cats.syntax.functor._
import cats.syntax.traverse._
import com.twilio.guardrail.generators.syntax.Scala._
import com.twilio.guardrail.generators.syntax._
import com.twilio.guardrail.languages.ScalaLanguage
import com.twilio.guardrail.protocol.terms.Responses
import com.twilio.guardrail.protocol.terms.client._
import com.twilio.guardrail.shims._
import com.twilio.guardrail.terms.RouteMeta
import java.util.Locale
import scala.collection.JavaConverters._
import scala.meta._
import _root_.io.swagger.v3.oas.models.PathItem.HttpMethod
import java.net.URI
@@ -1,20 +1,10 @@
package com.twilio.guardrail.generators

import cats.MonadError
import cats.data.{ EitherK, EitherT }
import cats.free.Free
import cats.implicits._
import cats.data.EitherK
import com.twilio.guardrail.generators.Http4sServerGenerator.ServerTermInterp.splitOperationParts
import com.twilio.guardrail.languages.{ LA, ScalaLanguage }
import com.twilio.guardrail.languages.ScalaLanguage
import com.twilio.guardrail.protocol.terms.{ Response, Responses }
import com.twilio.guardrail.terms.framework.{ FrameworkTerm, FrameworkTerms }
import com.twilio.guardrail.terms.{ RouteMeta, ScalaTerm, ScalaTerms, SwaggerTerm, SwaggerTerms }
import com.twilio.guardrail.{ StrictProtocolElems, SwaggerUtil, Target }
import scala.collection.JavaConverters._
import com.twilio.guardrail.terms.RouteMeta
import com.twilio.guardrail.StrictProtocolElems
import scala.meta._
import _root_.io.swagger.v3.oas.models.Operation
import _root_.io.swagger.v3.oas.models.media.Schema

object Http4sHelper {
def generateResponseDefinitions(operationId: String,
@@ -11,7 +11,6 @@ import com.twilio.guardrail.protocol.terms.{ Response, Responses }
import com.twilio.guardrail.protocol.terms.server._
import com.twilio.guardrail.shims._
import com.twilio.guardrail.terms.RouteMeta
import scala.collection.JavaConverters._
import scala.meta.{ Term, _ }
import _root_.io.swagger.v3.oas.models.PathItem.HttpMethod

@@ -1,19 +1,11 @@
package com.twilio.guardrail.generators.Java

import cats.instances.list._
import cats.syntax.traverse._
import cats.~>
import com.github.javaparser.JavaParser
import com.github.javaparser.ast.Modifier.{ ABSTRACT, FINAL, PRIVATE, PUBLIC }
import com.github.javaparser.ast.NodeList
import com.github.javaparser.ast.body.{ ClassOrInterfaceDeclaration, Parameter }
import com.github.javaparser.ast.expr._
import com.github.javaparser.ast.stmt.{ BlockStmt, ExpressionStmt, ReturnStmt }
import com.twilio.guardrail.Target
import com.twilio.guardrail.generators.syntax.Java._
import com.twilio.guardrail.languages.JavaLanguage
import com.twilio.guardrail.terms.framework._
import java.util

object DropwizardGenerator {
object FrameworkInterp extends (FrameworkTerm[JavaLanguage, ?] ~> Target) {
@@ -8,7 +8,7 @@ import cats.syntax.traverse._
import com.github.javaparser.JavaParser
import com.github.javaparser.ast.Modifier._
import com.github.javaparser.ast.{ Modifier, Node, NodeList }
import com.github.javaparser.ast.`type`.{ ClassOrInterfaceType, PrimitiveType, Type, VoidType, WildcardType }
import com.github.javaparser.ast.`type`.{ ClassOrInterfaceType, PrimitiveType, Type, VoidType }
import com.github.javaparser.ast.body._
import com.github.javaparser.ast.expr._
import com.github.javaparser.ast.stmt._
@@ -6,7 +6,7 @@ import _root_.io.swagger.v3.oas.models.media._
import cats.data.NonEmptyList
import cats.implicits._
import cats.~>
import com.github.javaparser.ast.`type`.{ ClassOrInterfaceType, PrimitiveType, Type }
import com.github.javaparser.ast.`type`.{ PrimitiveType, Type }
import com.twilio.guardrail.extract.{ Default, EmptyValueIsNull }
import com.twilio.guardrail.generators.syntax.Java._
import com.twilio.guardrail.generators.syntax.RichString
@@ -1,6 +1,5 @@
package com.twilio.guardrail.generators

import cats.syntax.either._
import cats.~>
import com.twilio.guardrail._
import com.twilio.guardrail.Common.resolveFile
@@ -1,24 +1,16 @@
package com.twilio.guardrail
package generators

import io.swagger.v3.oas.models.media.Schema
import io.swagger.v3.oas.models.parameters._
import com.twilio.guardrail.extract.{ Default, FileHashAlgorithm }
import com.twilio.guardrail.generators.syntax.RichString
import com.twilio.guardrail.languages.LA
import com.twilio.guardrail.languages.ScalaLanguage
import com.twilio.guardrail.shims._
import com.twilio.guardrail.terms.{ ScalaTerm, ScalaTerms, SwaggerTerm, SwaggerTerms }
import com.twilio.guardrail.terms.framework.{ FrameworkTerm, FrameworkTerms }
import java.util.Locale
import scala.meta._
import cats.MonadError
import com.twilio.guardrail.terms.{ ScalaTerms, SwaggerTerms }
import com.twilio.guardrail.terms.framework.FrameworkTerms
import cats.implicits._
import cats.arrow.FunctionK
import cats.free.Free
import cats.data.{ EitherK, EitherT }
import com.twilio.guardrail.SwaggerUtil.ResolvedType
import com.twilio.guardrail.extract.VendorExtension.VendorExtensible

case class RawParameterName private[generators] (value: String)
class ScalaParameters[L <: LA](val parameters: List[ScalaParameter[L]]) {

0 comments on commit 4ef618d

Please sign in to comment.
You can’t perform that action at this time.