Skip to content

Commit c8c04e4

Browse files
authored
Remove google-java-format from CI lint infrastructure
Differential Revision: D106575515 Pull Request resolved: pytorch#19831
1 parent 463fbe4 commit c8c04e4

2 files changed

Lines changed: 0 additions & 50 deletions

File tree

.ci/docker/common/install_linter.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,3 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1313
# NB: Install all linter dependencies, the caching of lintrunner init could be
1414
# done after Executorch becomes public
1515
pip_install -r requirements-lintrunner.txt
16-
17-
# Install google-java-format
18-
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
19-
chmod +x /opt/google-java-format

.github/workflows/lint.yml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -125,49 +125,3 @@ jobs:
125125
uses: ./.github/workflows/_link_check.yml
126126
with:
127127
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
128-
129-
android-java-format:
130-
runs-on: ubuntu-latest
131-
permissions:
132-
contents: read
133-
steps:
134-
- uses: actions/checkout@v4
135-
with:
136-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
137-
138-
- uses: actions/setup-java@v4
139-
with:
140-
distribution: 'temurin'
141-
java-version: '17'
142-
143-
- name: Check Java formatting
144-
run: |
145-
GOOGLE_JAVA_FORMAT_VERSION="1.24.0"
146-
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" \
147-
-o /tmp/google-java-format.jar
148-
149-
FILES_NEEDS_FORMAT=$(find extension/android/executorch_android/src/main/java/org/pytorch/executorch \
150-
extension/android/executorch_android/src/main/java/org/pytorch/executorch/extension/llm \
151-
extension/android/executorch_android/src/main/java/org/pytorch/executorch/annotations \
152-
extension/android/executorch_android/src/androidTest/java/org/pytorch/executorch \
153-
extension/benchmark/android/benchmark/app/src/main/java/org/pytorch/minibench \
154-
extension/benchmark/android/benchmark/app/src/androidTest/java/org/pytorch/minibench \
155-
-type f -name "*.java" 2>/dev/null | \
156-
xargs -r java -jar /tmp/google-java-format.jar -n)
157-
158-
if [ -n "$FILES_NEEDS_FORMAT" ]; then
159-
echo "Warning: The following files need formatting:"
160-
echo "$FILES_NEEDS_FORMAT"
161-
echo ""
162-
echo "Please use google-java-format from https://github.com/google/google-java-format/releases/"
163-
echo ""
164-
echo "To fix, run one of these commands:"
165-
echo " # Using xargs (recommended):"
166-
echo " find <paths> -type f -name '*.java' | xargs google-java-format -i"
167-
echo ""
168-
echo " # Or format specific files:"
169-
echo "$FILES_NEEDS_FORMAT" | while IFS= read -r file; do
170-
echo " google-java-format -i \"$file\""
171-
done
172-
exit 1
173-
fi

0 commit comments

Comments
 (0)