Skip to content

[Android] Format all Java files #12256

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ jobs:
script: |
FILES_NEEDS_FORMAT=$(/opt/google-java-format -n \
extension/android/executorch_android/src/main/java/org/pytorch/executorch/*.java \
extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm/*.java \
extension/android/executorch_android/src/main/java/org/pytorch/executorch/annotations/*.java \
extension/android/executorch_android/src/androidTest/java/org/pytorch/executorch/*.java \
examples/demo-apps/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/*.java \
extension/benchmark/android/benchmark/app/src/main/java/org/pytorch/minibench/*.java)
examples/demo-apps/android/LlamaDemo/app/src/androidTest/java/com/example/executorchllamademo/*.java \
extension/benchmark/android/benchmark/app/src/main/java/org/pytorch/minibench/*.java \
extension/benchmark/android/benchmark/app/src/androidTest/java/org/pytorch/minibench/*.java)
if [ -n "$FILES_NEEDS_FORMAT" ]; then
echo "Warning: The following files need formatting. Please use google-java-format."
echo "Use a binary from https://github.com/google/google-java-format/releases/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
import static org.junit.Assert.assertNotNull;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.runner.RunWith;
import org.junit.Test;
import org.junit.runner.RunWith;

/** Unit tests for {@link ExecuTorchRuntime}. */
@RunWith(AndroidJUnit4.class)
public class RuntimeInstrumentationTest {

@Test
public void testRuntimeApi() {
String[] ops = ExecuTorchRuntime.getRegisteredOps();
String[] backends = ExecuTorchRuntime.getRegisteredBackends();
@Test
public void testRuntimeApi() {
String[] ops = ExecuTorchRuntime.getRegisteredOps();
String[] backends = ExecuTorchRuntime.getRegisteredBackends();

assertNotNull(ops);
assertNotNull(backends);
assertNotNull(ops);
assertNotNull(backends);

for (String op : ops) {
assertNotNull(op);
}
for (String op : ops) {
assertNotNull(op);
}

for (String backend : backends) {
assertNotNull(backend);
}
for (String backend : backends) {
assertNotNull(backend);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.facebook.jni.HybridData;
import com.facebook.jni.annotations.DoNotStrip;
import java.io.File;

import org.pytorch.executorch.ExecuTorchRuntime;
import org.pytorch.executorch.annotations.Experimental;

Expand Down
Loading