Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scalafmt-core to 3.8.2 #330

Merged
merged 3 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
# manual
6d565ee5f4851d9c7bb3546f684cceeb23b9eb73
ef953f191a9007bbd7da816f445fde89680c6159

# Scala Steward: Reformat with scalafmt 3.8.2
a873c91c285bc60ea274eb612eb14c4be77e8d32
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.8.1
version = 3.8.2
runner.dialect = scala213
project.git = true
style = defaultWithAlign
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ object Settings {
| --use_tls=true|false Whether to use TLS. Default ${defaultSettings.useTls}
| --use_test_ca=true|false Whether to trust our fake CA. Requires --use_tls=true
| to have effect. Default ${defaultSettings.useTestCa}
| --use_pekkoHttp=true|false Whether to use pekko-http instead of Netty. Default ${defaultSettings.usePekkoHttp}
| --default_service_account Email of GCE default service account. Default ${defaultSettings.defaultServiceAccount}
| --service_account_key_file Path to service account json key file. ${defaultSettings.serviceAccountKeyFile}
| --use_pekkoHttp=true|false Whether to use pekko-http instead of Netty. Default ${defaultSettings
.usePekkoHttp}
| --default_service_account Email of GCE default service account. Default ${defaultSettings
.defaultServiceAccount}
| --service_account_key_file Path to service account json key file. ${defaultSettings
.serviceAccountKeyFile}
| --oauth_scope Scope for OAuth tokens. Default ${defaultSettings.oauthScope}
""".stripMargin)
System.exit(-1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class ErrorReportingSpec extends AnyWordSpec with Matchers with ScalaFutures wit

Http(sys)
.newServerAt("127.0.0.1", 0)
.bind((req => handler(req)): pekko.japi.function.Function[HttpRequest, CompletionStage[
.bind((req => handler(req)): pekko.japi.function.Function[HttpRequest,
CompletionStage[
HttpResponse]])
.toCompletableFuture
.get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ object MetadataImplSpec {
val TEXT_ENTRIES = List(("key-a", "value-a"), ("key-c", "value-c"), ("key-b", "value-b"))

val BINARY_ENTRIES = List(
("key-a-bin", ByteString.fromInts(10, 20, 30, 40)),
("key-c-bin", ByteString.fromInts(11, 21, 31, 41)),
("key-a-bin", ByteString.fromInts(10, 20, 30, 40)), ("key-c-bin", ByteString.fromInts(11, 21, 31, 41)),
("key-b-bin", ByteString.fromInts(12, 22, 32, 42)))

val DUPE_TEXT_KEY = "key-dupe"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ class HeadersSpec extends AnyWordSpec with Matchers {
"use percent-encoding" in {
// test cases taken from https://github.com/grpc/grpc-java/blob/79e75bace40cea7e4be72e7dcd1f41c3ad6ee857/api/src/test/java/io/grpc/StatusTest.java#L65
val inAndExpectedOut = Table(
("raw input", "expected encoded value"),
("my favorite character is i", "my favorite character is i"),
("raw input", "expected encoded value"), ("my favorite character is i", "my favorite character is i"),
("my favorite character is \n", "my favorite character is %0A"),
("my favorite character is \u0000", "my favorite character is %00"),
("my favorite character is %", "my favorite character is %25"),
Expand All @@ -52,10 +51,8 @@ class HeadersSpec extends AnyWordSpec with Matchers {
"should decode percent-encoded values" in {
// test cases taken from https://github.com/grpc/grpc-java/blob/79e75bace40cea7e4be72e7dcd1f41c3ad6ee857/api/src/test/java/io/grpc/StatusTest.java#L65
val inAndExpectedOut = Table(
("raw input", "expected decoded value"),
(Array[Byte]('H', 'e', 'l', 'l', 'o'), "Hello"),
(Array[Byte]('H', '%', '6', '1', 'o'), "Hao"),
(Array[Byte]('H', '%', '0', 'A', 'o'), "H\no"),
("raw input", "expected decoded value"), (Array[Byte]('H', 'e', 'l', 'l', 'o'), "Hello"),
(Array[Byte]('H', '%', '6', '1', 'o'), "Hao"), (Array[Byte]('H', '%', '0', 'A', 'o'), "H\no"),
(Array[Byte]('%', 'F', '0', '%', '9', '0', '%', '8', '0', '%', '8', '1'), "𐀁"),
(Array[Byte]('a', 'b', 'c', '%', 'C', '5', '%', '8', '2'), "abcΕ‚"))

Expand All @@ -67,11 +64,8 @@ class HeadersSpec extends AnyWordSpec with Matchers {

"should decode as is in case two chars following percent cannot be decoded as hex" in {
val inAndExpectedOut = Table(
("raw input", "expected decoded value"),
(Array[Byte]('%', 'G'), "%G"),
(Array[Byte]('%', 'G', '0'), "%G0"),
(Array[Byte]('%', 'G', '0', '%', ',', '0'), "%G0%,0"),
(Array[Byte]('%', '%', '0', '%', '%'), "%%0%%"))
("raw input", "expected decoded value"), (Array[Byte]('%', 'G'), "%G"), (Array[Byte]('%', 'G', '0'), "%G0"),
(Array[Byte]('%', 'G', '0', '%', ',', '0'), "%G0%,0"), (Array[Byte]('%', '%', '0', '%', '%'), "%%0%%"))

forAll(inAndExpectedOut) { (in, expected) =>
val actual = `Status-Message`.parse(new String(in))
Expand Down
3 changes: 2 additions & 1 deletion sbt-plugin/src/sbt-test/gen-java/01-gen-basic-java/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ javacOptions += "-Xdoclint:all"

pekkoGrpcGeneratedLanguages := Seq(PekkoGrpc.Java)

libraryDependencies += "com.google.protobuf" % "protobuf-java" % org.apache.pekko.grpc.gen.BuildInfo.googleProtobufJavaVersion % "protobuf"
libraryDependencies += "com.google.protobuf" % "protobuf-java" % org.apache.pekko.grpc.gen.BuildInfo
.googleProtobufJavaVersion % "protobuf"
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ javacOptions += "-Xdoclint:all"

pekkoGrpcGeneratedLanguages := Seq(PekkoGrpc.Java)

libraryDependencies += "com.google.protobuf" % "protobuf-java" % org.apache.pekko.grpc.gen.BuildInfo.googleProtobufJavaVersion % "protobuf"
libraryDependencies += "com.google.protobuf" % "protobuf-java" % org.apache.pekko.grpc.gen.BuildInfo
.googleProtobufJavaVersion % "protobuf"
Loading