This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-grpc.git
The following commit(s) were added to refs/heads/main by this push:
new 2262fabc chore: unify formatter config - standardize aliases, add
JDK17 setting (#725)
2262fabc is described below
commit 2262fabcf781890256aee47f5712927cd4c3dcdb
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Sun Jun 14 21:15:08 2026 +0800
chore: unify formatter config - standardize aliases, add JDK17 setting
(#725)
* chore: unify formatter config across pekko sub-projects
Motivation:
Align formatter plugins, command aliases, and JDK settings with other
pekko sub-projects to reduce maintenance burden.
Modification:
- Standardize checkCodeStyle/applyCodeStyle command aliases
- Add ThisBuild / javafmtFormatterCompatibleJavaVersion := 17 where missing
- Replace custom verifyCodeFmt tasks with standard aliases where applicable
- Upgrade sbt-java-formatter plugin where needed
Result:
Consistent formatter configuration across all pekko sub-projects.
Tests:
Not run - build config change only
References:
None - formatter unification across pekko sub-projects
* fix: add checkCodeStyle to CI check-code-style job
Motivation:
The check-code-style CI job only ran MiMa binary compatibility checks
but did not verify code formatting (scalafmt, javafmt, headers).
Modification:
Add sbt checkCodeStyle step before the binary-compatibility check.
Result:
CI now validates code style (scalafmt + javafmt + headers) on every PR.
* fix: apply javafmt 0.12.0 formatting to 2 Java files
Motivation:
CI Checks job failed because 2 Java files in plugin-tester-java
were not formatted with javafmt 0.12.0.
Modification:
Run javafmtAll to format GreeterActor.java and GreeterServiceImpl.java.
Result:
Checks CI job passes.
---
.github/workflows/build-test.yml | 5 +++++
build.sbt | 3 +++
.../myapp/typedhelloworld/GreeterActor.java | 4 +++-
.../myapp/typedhelloworld/GreeterServiceImpl.java | 22 ++++++++++------------
4 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index b5848014..747b5b29 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -42,6 +42,11 @@ jobs:
- name: Cache Coursier cache
uses: coursier/cache-action@95e5b1029b6b86e7bac033ee44a0697d8a527d2d #
v8.1.1
+ - name: Code style check
+ run: |-
+ cp .jvmopts-ci .jvmopts
+ sbt checkCodeStyle
+
- name: Binary-compatibility check
run: |-
cp .jvmopts-ci .jvmopts
diff --git a/build.sbt b/build.sbt
index 05e401cd..517c29dc 100644
--- a/build.sbt
+++ b/build.sbt
@@ -44,6 +44,9 @@ lazy val mkBatAssemblyTask = taskKey[File]("Create a Windows
bat assembly")
ThisBuild / javafmtFormatterCompatibleJavaVersion := 17
+addCommandAlias("checkCodeStyle", "scalafmtCheckAll; scalafmtSbtCheck;
javafmtCheckAll; +headerCheckAll")
+addCommandAlias("applyCodeStyle", "+headerCreateAll; scalafmtAll; scalafmtSbt;
javafmtAll")
+
val pekkoGrpcCodegenId = s"$pekkoPrefix-codegen"
lazy val codegen = Project(id = "codegen", base = file("codegen"))
.enablePlugins(SbtTwirl, BuildInfoPlugin)
diff --git
a/plugin-tester-java/src/main/java/example/myapp/typedhelloworld/GreeterActor.java
b/plugin-tester-java/src/main/java/example/myapp/typedhelloworld/GreeterActor.java
index 62e04303..e7364063 100644
---
a/plugin-tester-java/src/main/java/example/myapp/typedhelloworld/GreeterActor.java
+++
b/plugin-tester-java/src/main/java/example/myapp/typedhelloworld/GreeterActor.java
@@ -24,7 +24,8 @@ import org.apache.pekko.actor.typed.javadsl.Receive;
public class GreeterActor extends
AbstractBehavior<GreeterActor.GreetingCommand> {
public static interface GreetingCommand {}
- public static class ChangeGreeting implements GreetingCommand{
+
+ public static class ChangeGreeting implements GreetingCommand {
public final String newGreeting;
public ChangeGreeting(String newGreeting) {
@@ -51,6 +52,7 @@ public class GreeterActor extends
AbstractBehavior<GreeterActor.GreetingCommand>
public static Behavior<GreetingCommand> create(final String initialGreeting)
{
return Behaviors.setup(context -> new GreeterActor(context,
initialGreeting));
}
+
private GreeterActor(ActorContext<GreetingCommand> context, String
initialGreeting) {
super(context);
}
diff --git
a/plugin-tester-java/src/main/java/example/myapp/typedhelloworld/GreeterServiceImpl.java
b/plugin-tester-java/src/main/java/example/myapp/typedhelloworld/GreeterServiceImpl.java
index 7fd74494..5cf3ead3 100644
---
a/plugin-tester-java/src/main/java/example/myapp/typedhelloworld/GreeterServiceImpl.java
+++
b/plugin-tester-java/src/main/java/example/myapp/typedhelloworld/GreeterServiceImpl.java
@@ -27,24 +27,22 @@ public final class GreeterServiceImpl implements
GreeterService {
private final ActorSystem system;
private final ActorRef<GreeterActor.GreetingCommand> greeterActor;
- public GreeterServiceImpl(ActorSystem system,
ActorRef<GreeterActor.GreetingCommand> greeterActor) {
+ public GreeterServiceImpl(
+ ActorSystem system, ActorRef<GreeterActor.GreetingCommand> greeterActor)
{
this.system = system;
this.greeterActor = greeterActor;
}
public CompletionStage<HelloReply> sayHello(HelloRequest in) {
- CompletionStage<GreeterActor.Greeting> response = AskPattern.ask(
- greeterActor,
- replyTo -> new GreeterActor.GetGreeting(replyTo),
- Duration.ofSeconds(5),
- system.scheduler()
- );
+ CompletionStage<GreeterActor.Greeting> response =
+ AskPattern.ask(
+ greeterActor,
+ replyTo -> new GreeterActor.GetGreeting(replyTo),
+ Duration.ofSeconds(5),
+ system.scheduler());
return response.thenApply(
- message ->
- HelloReply.newBuilder()
- .setMessage(((GreeterActor.Greeting) message).greeting)
- .build()
- );
+ message ->
+ HelloReply.newBuilder().setMessage(((GreeterActor.Greeting)
message).greeting).build());
}
public CompletionStage<ChangeResponse> changeGreeting(ChangeRequest in) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]