Skip to content

Commit a25fa76

Browse files
authored
Merge pull request #1043 from xuwei-k/scalafmt-wildcard-syntax
update `.scalafmt.conf`. enforce new wildcard syntax
2 parents 92fe003 + 1f9f864 commit a25fa76

File tree

17 files changed

+24
-17
lines changed

17 files changed

+24
-17
lines changed

.scalafmt.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ spaces.inImportCurlyBraces = true # more idiomatic to include whitepsace in im
1212
trailingCommas = preserve
1313
newlines.afterCurlyLambda = preserve
1414
version = 3.9.8
15+
rewrite.scala3.convertToNewSyntax = true
16+
rewrite.scala3.newSyntax.control = false
17+
runner.dialectOverride {
18+
allowSignificantIndentation = false
19+
allowAsForImportRename = false
20+
allowStarWildcardImport = false
21+
}

integration-tests/src/test/scala/play/api/libs/ws/ahc/XMLRequestSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class XMLRequestSpec extends Specification with AfterAll with MustMatchers {
4646

4747
override def bodyAsBytes: ByteString = ByteString.fromArray(byteArray)
4848

49-
override def bodyAsSource: org.apache.pekko.stream.scaladsl.Source[ByteString, _] = ???
49+
override def bodyAsSource: org.apache.pekko.stream.scaladsl.Source[ByteString, ?] = ???
5050
}
5151

5252
"write an XML node" in {

play-ahc-ws-standalone/src/main/scala/play/api/libs/oauth/OAuth.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class OAuthCalculator(consumerKey: ConsumerKey, requestToken: RequestToken)
107107
private val ahcRequestToken = new AHCRequestToken(requestToken.token, requestToken.secret)
108108
private val calculator = new OAuthSignatureCalculator(ahcConsumerKey, ahcRequestToken)
109109

110-
override def calculateAndAddSignature(request: Request, requestBuilder: RequestBuilderBase[_]): Unit = {
110+
override def calculateAndAddSignature(request: Request, requestBuilder: RequestBuilderBase[?]): Unit = {
111111
calculator.calculateAndAddSignature(request, requestBuilder)
112112
}
113113
}

play-ahc-ws-standalone/src/main/scala/play/api/libs/ws/ahc/AhcLoggerFactory.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class AhcLoggerFactory(lf: ILoggerFactory = SLF4JLoggerFactory.getILoggerFactory
2424
}
2525
}
2626

27-
def apply(clazz: Class[_]): NoDepsLogger = createLogger(clazz.getName)
27+
def apply(clazz: Class[?]): NoDepsLogger = createLogger(clazz.getName)
2828
def apply(name: String): NoDepsLogger = createLogger(name)
2929

3030
}

play-ahc-ws-standalone/src/main/scala/play/api/libs/ws/ahc/StandaloneAhcWSClient.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class StandaloneAhcWSClient @Inject() (asyncHttpClient: AsyncHttpClient)(implici
113113

114114
val wrap = new Publisher[HttpResponseBodyPart]() {
115115
override def subscribe(
116-
s: Subscriber[_ >: HttpResponseBodyPart]
116+
s: Subscriber[? >: HttpResponseBodyPart]
117117
): Unit = {
118118
publisher.subscribe(new Subscriber[HttpResponseBodyPart] {
119119
override def onSubscribe(sub: Subscription): Unit =
@@ -155,7 +155,7 @@ class StandaloneAhcWSClient @Inject() (asyncHttpClient: AsyncHttpClient)(implici
155155
streamStarted.future
156156
}
157157

158-
private[ahc] def blockingToByteString(bodyAsSource: Source[ByteString, _]) = {
158+
private[ahc] def blockingToByteString(bodyAsSource: Source[ByteString, ?]) = {
159159
StandaloneAhcWSClient.logger.warn(
160160
s"blockingToByteString is a blocking and unsafe operation!"
161161
)

play-ahc-ws-standalone/src/main/scala/play/api/libs/ws/ahc/StandaloneAhcWSResponse.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class StandaloneAhcWSResponse(ahcResponse: AHCResponse)
4747
*/
4848
override lazy val bodyAsBytes: ByteString = ByteString.fromArray(underlying[AHCResponse].getResponseBodyAsBytes)
4949

50-
override lazy val bodyAsSource: Source[ByteString, _] = Source.single(bodyAsBytes)
50+
override lazy val bodyAsSource: Source[ByteString, ?] = Source.single(bodyAsBytes)
5151
}
5252

5353
object StandaloneAhcWSResponse {

play-ahc-ws-standalone/src/main/scala/play/api/libs/ws/ahc/Streamed.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class DefaultStreamedAsyncHandler[T](
7979
}
8080

8181
private case object EmptyPublisher extends Publisher[HttpResponseBodyPart] {
82-
def subscribe(s: Subscriber[_ >: HttpResponseBodyPart]): Unit = {
82+
def subscribe(s: Subscriber[? >: HttpResponseBodyPart]): Unit = {
8383
if (s eq null)
8484
throw new NullPointerException("Subscriber must not be null, rule 1.9")
8585
s.onSubscribe(CancelledSubscription)

play-ahc-ws-standalone/src/main/scala/play/api/libs/ws/ahc/StreamedResponse.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class StreamedResponse(
115115
*/
116116
override lazy val bodyAsBytes: ByteString = client.blockingToByteString(bodyAsSource)
117117

118-
override lazy val bodyAsSource: Source[ByteString, _] = {
118+
override lazy val bodyAsSource: Source[ByteString, ?] = {
119119
Source
120120
.fromPublisher(publisher)
121121
.map((bodyPart: HttpResponseBodyPart) => ByteString.fromArray(bodyPart.getBodyPartBytes))

play-ahc-ws-standalone/src/main/scala/play/api/libs/ws/ahc/cache/CacheAsyncConnection.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class AsyncCacheableConnection[T](
5252
}
5353

5454
asyncHandler match {
55-
case progressAsyncHandler: ProgressAsyncHandler[_] =>
55+
case progressAsyncHandler: ProgressAsyncHandler[?] =>
5656
progressAsyncHandler.onHeadersWritten()
5757
progressAsyncHandler.onContentWritten()
5858
case _ =>

play-ahc-ws-standalone/src/main/scala/play/api/libs/ws/ahc/cache/CachingAsyncHttpClient.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CachingAsyncHttpClient(underlying: AsyncHttpClient, ahcHttpCache: AhcHttpC
6363
}
6464

6565
@throws(classOf[IOException])
66-
protected def execute[T](request: Request, handler: AsyncCompletionHandler[T], future: ListenableFuture[_])(implicit
66+
protected def execute[T](request: Request, handler: AsyncCompletionHandler[T], future: ListenableFuture[?])(implicit
6767
ec: ExecutionContext
6868
): ListenableFuture[T] = {
6969
if (logger.isTraceEnabled) {

0 commit comments

Comments
 (0)