-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* modify .gitignore * add ok idea files * add google java format idea files * remove old test reporter * add google java format CI check * add google java format readme * remove checkstyle * google java format * fix runner spec * reformat * add note about linux * add fix script
- Loading branch information
Showing
1,404 changed files
with
72,725 additions
and
68,091 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
set -u | ||
|
||
script_name="" | ||
|
||
case "$(uname -sr)" in | ||
|
||
Darwin*) | ||
script_name="google-java-format_darwin-arm64" | ||
;; | ||
|
||
Linux*) | ||
script_name="google-java-format_linux-x86-64" | ||
;; | ||
*) | ||
echo 'Unsupported OS' | ||
exit 1 | ||
;; | ||
esac | ||
|
||
JAVA_FILES=$(find . -name "*.java" -type f) | ||
|
||
invalid_files=0 | ||
|
||
echo "Following files are formatted incorrectly:"; | ||
# TODO: remove '--skip-reflowing-long-strings' once https://github.com/google/google-java-format/issues/566 is fixed | ||
for FILE in $JAVA_FILES; do | ||
if [[ "$*" == *--fix* ]]; then | ||
./$script_name --skip-reflowing-long-strings --replace "$FILE" > /dev/null | ||
else | ||
./$script_name --set-exit-if-changed --skip-reflowing-long-strings "$FILE" > /dev/null | ||
fi | ||
if [ $? -ne 0 ]; then | ||
echo "$FILE" | ||
((invalid_files++)) | ||
fi | ||
done | ||
|
||
if [ "$invalid_files" -ne 0 ]; then | ||
echo "Found $invalid_files incorrectly formatted files (listed above), run google-java-format to fix them."; | ||
exit 1 | ||
else | ||
echo "All files are formatted correctly." | ||
fi | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Google java format | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Download and run google java format | ||
run: | | ||
ls -la | ||
curl -sSLO "https://github.com/google/google-java-format/releases/download/v$VERSION/google-java-format_linux-x86-64" | ||
chmod a+x google-java-format_linux-x86-64 | ||
./.github/scripts/check-google-java-format.sh | ||
shell: bash | ||
env: | ||
VERSION: 1.23.0 | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.