Skip to content

Commit cbc097c

Browse files
Update scalafmt-core to 3.8.1 (#339)
* Update scalafmt-core to 3.8.1 * Reformat with scalafmt 3.8.1 Executed command: scalafmt --non-interactive * Add 'Reformat with scalafmt 3.8.1' to .git-blame-ignore-revs --------- Co-authored-by: scala-steward <scala-steward>
1 parent 89f55f3 commit cbc097c

File tree

5 files changed

+26
-24
lines changed

5 files changed

+26
-24
lines changed

.git-blame-ignore-revs

+3
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ f7dccf8d205c1d4f9bd5dbbf9680a6b9d175b444
66

77
# Scala Steward: Reformat with scalafmt 3.7.17
88
cc4f48597d3151542ecec3c159159e1793926314
9+
10+
# Scala Steward: Reformat with scalafmt 3.8.1
11+
084144fd6e2c78ee7e3763eace52e9185007175c

.scalafmt.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
runner.dialect = scala3
2-
version = 3.7.17
2+
version = 3.8.1
33
maxColumn = 120

core/src/main/scala/sttp/model/MediaType.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ case class MediaType(
6363

6464
def isModel: Boolean = mainType.equalsIgnoreCase("model")
6565

66-
// Cache 'toString' given that it's called in the hot path
66+
// Cache 'toString' given that it's called in the hot path
6767
// of request processing to generate headers.
6868
private lazy val toStringCache: String = {
6969
val sb = new java.lang.StringBuilder(32) // "application/json; charset=utf-8".length == 31 ;)

core/src/main/scala/sttp/model/Part.scala

+18-19
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,27 @@ case class Part[+T](
4141
// enumerate all variants so that overload resolution works correctly
4242
override def header(h: String): Option[String] = super.header(h)
4343

44-
/**
45-
* Returns the value of the `Content-Disposition` header, which should be used when sending this part in a
46-
* multipart request.
47-
*
48-
* The syntax is specified by [[https://datatracker.ietf.org/doc/html/rfc6266#section-4.1 RFC6266 section 4.1]].
49-
* For safety and simplicity, disposition parameter values are represented as `quoted-string`, defined in
50-
* [[https://datatracker.ietf.org/doc/html/rfc9110#section-5.6.4 RFC9110 section 5.6.4]].
51-
*
52-
* `quoted-string` allows usage of visible ASCII characters (`%x21-7E`), except for `"` and `\`, which must be escaped
53-
* with a backslash. Additionally, space and horizontal tab is allowed, as well as octets `0x80-FF` (`obs-data`).
54-
* In practice this means that - while not explicitly allowed - non-ASCII UTF-8 characters are valid
55-
* according to this grammar. Additionally, [[https://datatracker.ietf.org/doc/html/rfc6532#section-3.2 RFC6532]]
56-
* makes it more explicit that non-ASCII UTF-8 is allowed. Control characters are not allowed.
57-
*
58-
* This method makes sure that `"` and `\` are escaped, while leaving possible rejection of forbidden characters to
59-
* lower layers (`sttp` backends).
60-
*/
44+
/** Returns the value of the `Content-Disposition` header, which should be used when sending this part in a multipart
45+
* request.
46+
*
47+
* The syntax is specified by [[https://datatracker.ietf.org/doc/html/rfc6266#section-4.1 RFC6266 section 4.1]]. For
48+
* safety and simplicity, disposition parameter values are represented as `quoted-string`, defined in
49+
* [[https://datatracker.ietf.org/doc/html/rfc9110#section-5.6.4 RFC9110 section 5.6.4]].
50+
*
51+
* `quoted-string` allows usage of visible ASCII characters (`%x21-7E`), except for `"` and `\`, which must be
52+
* escaped with a backslash. Additionally, space and horizontal tab is allowed, as well as octets `0x80-FF`
53+
* (`obs-data`). In practice this means that - while not explicitly allowed - non-ASCII UTF-8 characters are valid
54+
* according to this grammar. Additionally, [[https://datatracker.ietf.org/doc/html/rfc6532#section-3.2 RFC6532]]
55+
* makes it more explicit that non-ASCII UTF-8 is allowed. Control characters are not allowed.
56+
*
57+
* This method makes sure that `"` and `\` are escaped, while leaving possible rejection of forbidden characters to
58+
* lower layers (`sttp` backends).
59+
*/
6160
def contentDispositionHeaderValue: String = {
6261
def escape(str: String): String = str.flatMap {
63-
case '"' => "\\\""
62+
case '"' => "\\\""
6463
case '\\' => "\\\\"
65-
case c => c.toString
64+
case c => c.toString
6665
}
6766
"form-data; " + dispositionParamsSeq.map { case (k, v) => s"""$k="${escape(v)}"""" }.mkString("; ")
6867
}

core/src/main/scala/sttp/model/UriInterpolator.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -731,14 +731,14 @@ object UriInterpolator {
731731
case Singleton(ExpressionToken(s: Array[_])) =>
732732
b ++= s.flatMap(anyToStringOpt)
733733
doToSeq(tailTs)
734-
case valueTs if(valueTs.size == 1) =>
735-
// This case is equivalent to the next one but optimizes for the
734+
case valueTs if (valueTs.size == 1) =>
735+
// This case is equivalent to the next one but optimizes for the
736736
// frequent scenario where the sequence contains a single element.
737737
valueTs.get(0) match {
738738
case StringToken(s) => b += decode(s, decodePlusAsSpace)
739739
case ExpressionToken(e) => anyToStringOpt(e).foreach(b += _)
740740
case EqInQuery => b += "="
741-
case _ =>
741+
case _ =>
742742
}
743743
doToSeq(tailTs)
744744
case valueTs =>

0 commit comments

Comments
 (0)