From 5b4da595f51bfff89d66bb402cc717e4c9e7c5aa Mon Sep 17 00:00:00 2001 From: Daniel Slapman Date: Sun, 31 Mar 2024 23:49:51 +0200 Subject: [PATCH] Lint edsl --- .../tcb/mockingbird/edsl/ExampleSet.scala | 25 ++++++++----------- .../interpreter/AsyncScalaTestSuite.scala | 8 +++--- .../tcb/mockingbird/edsl/model/Check.scala | 13 ++++++---- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/ExampleSet.scala b/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/ExampleSet.scala index d290e333..1b0ac0a8 100644 --- a/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/ExampleSet.scala +++ b/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/ExampleSet.scala @@ -27,8 +27,8 @@ trait ExampleSet[HttpResponseR] { liftF[Step, Unit](Describe(text, pos)) /** - * In tests, makes an HTTP request with the specified parameters or adds a sample request to the Markdown, - * which can be executed with the curl command. + * In tests, makes an HTTP request with the specified parameters or adds a sample request to the Markdown, which can + * be executed with the curl command. * * @param method * HTTP method used. @@ -41,9 +41,8 @@ trait ExampleSet[HttpResponseR] { * @param query * URL query parameters. * @return - * Returns an object representing the result of the request execution; - * the specific type depends on the DSL interpreter. - * The return value can only be used by passing it to the [[checkHttp]] method. + * Returns an object representing the result of the request execution; the specific type depends on the DSL + * interpreter. The return value can only be used by passing it to the [[checkHttp]] method. */ final def sendHttp( method: HttpMethod, @@ -57,20 +56,18 @@ trait ExampleSet[HttpResponseR] { liftF[Step, HttpResponseR](SendHttp[HttpResponseR](HttpRequest(method, path, body, headers, query), pos)) /** - * In tests, verifies that the received HTTP response matches the expectations. - * When generating Markdown, inserts the expected response based on the specified expectations. - * If no expectations are specified, nothing will be added. + * In tests, verifies that the received HTTP response matches the expectations. When generating Markdown, inserts the + * expected response based on the specified expectations. If no expectations are specified, nothing will be added. * * @param response * the result of executing [[sendHttp]], the type depends on the DSL interpreter. * @param expects - * expectations placed on the result of the HTTP request. - * Expectations concern the response code, request body, and headers received from the server. + * expectations placed on the result of the HTTP request. Expectations concern the response code, request body, and + * headers received from the server. * @return - * returns the parsed response from the server. When generating Markdown, - * since there is no actual response from the server, it constructs a response based - * on the provided response expectations. - * Only information relevant to the specified checks is added to the Markdown. + * returns the parsed response from the server. When generating Markdown, since there is no actual response from the + * server, it constructs a response based on the provided response expectations. Only information relevant to the + * specified checks is added to the Markdown. */ final def checkHttp(response: HttpResponseR, expects: HttpResponseExpected)(implicit pos: source.Position diff --git a/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/interpreter/AsyncScalaTestSuite.scala b/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/interpreter/AsyncScalaTestSuite.scala index 41cd1106..c46397d1 100644 --- a/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/interpreter/AsyncScalaTestSuite.scala +++ b/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/interpreter/AsyncScalaTestSuite.scala @@ -23,11 +23,11 @@ import ru.tinkoff.tcb.mockingbird.edsl.model.ValueMatcher.* /** * Base trait for generating a set of tests from an [[ru.tinkoff.tcb.mockingbird.edsl.ExampleSet ExampleSet]]. * - * This trait inherits from AsyncFunSuiteLike in the [[https://www.scalatest.org/ ScalaTest]] framework, so you can - * add additional tests inside it or use + * This trait inherits from AsyncFunSuiteLike in the [[https://www.scalatest.org/ ScalaTest]] framework, so you can add + * additional tests inside it or use * [[https://www.scalatest.org/user_guide/sharing_fixtures#beforeAndAfter BeforeAndAfter]] and/or - * [[https://www.scalatest.org/user_guide/sharing_fixtures#composingFixtures BeforeAndAfterEach]] to manage - * the setup of the necessary environment for executing tests, including using + * [[https://www.scalatest.org/user_guide/sharing_fixtures#composingFixtures BeforeAndAfterEach]] to manage the setup of + * the necessary environment for executing tests, including using * [[https://github.com/testcontainers/testcontainers-scala testcontainers-scala]]. */ trait AsyncScalaTestSuite extends AsyncFunSuiteLike { diff --git a/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/model/Check.scala b/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/model/Check.scala index 6ecd2d60..fe6078ac 100644 --- a/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/model/Check.scala +++ b/backend/edsl/src/main/scala/ru/tinkoff/tcb/mockingbird/edsl/model/Check.scala @@ -6,8 +6,8 @@ sealed trait ValueMatcher[T] extends Product with Serializable object ValueMatcher { /** - * Indicates that a specific value of type 'T' is expected, and if there is a mismatch, - * the generated test will fail with an error. + * Indicates that a specific value of type 'T' is expected, and if there is a mismatch, the generated test will fail + * with an error. * * @param value * The value used for comparison and display when generating an example server response in markdown. @@ -18,7 +18,8 @@ object ValueMatcher { * Indicates that any value of type 'T' is expected. * * @param example - * This value will be displayed in the markdown document when generated in the description of the example server response. + * This value will be displayed in the markdown document when generated in the description of the example server + * response. */ final case class AnyValue[T](example: T) extends ValueMatcher[T] @@ -61,7 +62,8 @@ object Check { final case class CheckInteger(matcher: ValueMatcher[Long]) extends Check /** - * Indicates that JSON is expected. Implementations of this trait allow for a more detailed description of expectations. + * Indicates that JSON is expected. Implementations of this trait allow for a more detailed description of + * expectations. * @group CheckJson */ sealed trait CheckJson extends Check @@ -89,7 +91,8 @@ object Check { final case class CheckJsonObject(fields: (String, CheckJson)*) extends CheckJson /** - * An array with the specified elements, the order is important. The array being checked may contain additional elements at the end. + * An array with the specified elements, the order is important. The array being checked may contain additional + * elements at the end. * @group CheckJson */ final case class CheckJsonArray(items: CheckJson*) extends CheckJson