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

Run javafmt check all #288

Merged
merged 2 commits into from
Aug 1, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/validate-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
key: build-target-${{ hashFiles('**/*.sbt', 'project/build.properties', 'project/**/*.scala') }}

- name: Check code is formatted
run: sbt javafmtCheck
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original javafmtCheck didn't check if Java test sources were formatted

run: sbt javafmtCheckAll

- name: Check for missing formatting
run: git diff --exit-code --color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,20 @@ public static void main(String[] args) throws Exception {
final CorsServerExample app = new CorsServerExample();

final CompletionStage<ServerBinding> futureBinding =
Http.get(system).newServerAt("localhost", 8080).bind(app.createRoute());

futureBinding.whenComplete((binding, exception) -> {
if (binding != null) {
system.log().info("Server online at http://localhost:8080/\nPress RETURN to stop...");
} else {
system.log().error("Failed to bind HTTP endpoint, terminating system", exception);
system.terminate();
}
});
Http.get(system).newServerAt("localhost", 8080).bind(app.createRoute());

futureBinding.whenComplete(
(binding, exception) -> {
if (binding != null) {
system.log().info("Server online at http://localhost:8080/\nPress RETURN to stop...");
} else {
system.log().error("Failed to bind HTTP endpoint, terminating system", exception);
system.terminate();
}
});

System.in.read(); // let it run until user presses return
futureBinding
.thenCompose(ServerBinding::unbind)
.thenAccept(unbound -> system.terminate());
futureBinding.thenCompose(ServerBinding::unbind).thenAccept(unbound -> system.terminate());
}

private Route createRoute() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ public Route createRoute() {
timeout,
this::mkTimeoutResponse,
() -> {
silentSleep(
5000); // too long, but note that this will NOT activate
// withRequestTimeout, see below
silentSleep(5000); // too long, but note that this will NOT activate
// withRequestTimeout, see below
return complete(index());
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void testEntitySizeNoLimit() {
mat ->
Directives.<ByteString>onSuccess(
entity // fails to infer type parameter with some older
// oracle JDK versions
// oracle JDK versions
.withoutSizeLimit()
.getDataBytes()
.runWith(Sink.<ByteString>head(), mat),
Expand All @@ -74,7 +74,7 @@ private TestRoute routeWithLimit() {
mat ->
Directives.<ByteString>onSuccess(
entity // fails to infer type parameter with some older oracle
// JDK versions
// JDK versions
.withSizeLimit(5)
.getDataBytes()
.runWith(Sink.head(), mat),
Expand Down
Loading