From 37469ab348300548e6bce0fa07f3b5ef6c71de99 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Wed, 27 May 2026 16:06:38 -0700 Subject: [PATCH] Remove `google-java-format` from CI lint infrastructure Summary: All Android source files in ExecuTorch have been converted from Java to Kotlin as part of the ongoing Java-to-Kotlin migration. The `google-java-format` linter and CI job are no longer needed since there are no Java files left to format. This removes: - The `google-java-format` binary installation from the Docker linter image (`.ci/docker/common/install_linter.sh`) - The `android-java-format` CI job from the lint workflow (`.github/workflows/lint.yml`) Differential Revision: D106575515 --- .ci/docker/common/install_linter.sh | 4 --- .github/workflows/lint.yml | 46 ----------------------------- 2 files changed, 50 deletions(-) diff --git a/.ci/docker/common/install_linter.sh b/.ci/docker/common/install_linter.sh index 52d2d262685..4a796a72d54 100755 --- a/.ci/docker/common/install_linter.sh +++ b/.ci/docker/common/install_linter.sh @@ -13,7 +13,3 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" # NB: Install all linter dependencies, the caching of lintrunner init could be # done after Executorch becomes public pip_install -r requirements-lintrunner.txt - -# Install google-java-format -curl -L --retry 3 --retry-all-errors https://github.com/google/google-java-format/releases/download/v1.23.0/google-java-format_linux-x86-64 > /opt/google-java-format -chmod +x /opt/google-java-format diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b26247d2333..b21cc527b8d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -125,49 +125,3 @@ jobs: uses: ./.github/workflows/_link_check.yml with: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} - - android-java-format: - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} - - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - - name: Check Java formatting - run: | - GOOGLE_JAVA_FORMAT_VERSION="1.24.0" - curl -sSfL "https://github.com/google/google-java-format/releases/download/v${GOOGLE_JAVA_FORMAT_VERSION}/google-java-format-${GOOGLE_JAVA_FORMAT_VERSION}-all-deps.jar" \ - -o /tmp/google-java-format.jar - - FILES_NEEDS_FORMAT=$(find extension/android/executorch_android/src/main/java/org/pytorch/executorch \ - extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm \ - extension/android/executorch_android/src/main/java/org/pytorch/executorch/annotations \ - extension/android/executorch_android/src/androidTest/java/org/pytorch/executorch \ - extension/benchmark/android/benchmark/app/src/main/java/org/pytorch/minibench \ - extension/benchmark/android/benchmark/app/src/androidTest/java/org/pytorch/minibench \ - -type f -name "*.java" 2>/dev/null | \ - xargs -r java -jar /tmp/google-java-format.jar -n) - - if [ -n "$FILES_NEEDS_FORMAT" ]; then - echo "Warning: The following files need formatting:" - echo "$FILES_NEEDS_FORMAT" - echo "" - echo "Please use google-java-format from https://github.com/google/google-java-format/releases/" - echo "" - echo "To fix, run one of these commands:" - echo " # Using xargs (recommended):" - echo " find -type f -name '*.java' | xargs google-java-format -i" - echo "" - echo " # Or format specific files:" - echo "$FILES_NEEDS_FORMAT" | while IFS= read -r file; do - echo " google-java-format -i \"$file\"" - done - exit 1 - fi