Skip to content

Commit

Permalink
bump google java format to 1.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
asalan316 committed Jul 24, 2024
1 parent 42cf764 commit 1473552
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/java-ci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
run: |
sh ./style-guide/google-format-ci-v0.1.sh
env:
GOOGLE_JAR_VERSION: 1.11.0
GOOGLE_JAR_NAME: google-java-format-1.11.0-all-deps.jar
GOOGLE_JAR_VERSION: 1.22.0
GOOGLE_JAR_NAME: google-java-format-1.22.0-all-deps.jar

- name: Checkstyle
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ private SpecificDateScheduleEntity createCompensatorySchedule(

return compenstatorySchedule;
}

/**
* Calls private helper methods to delete the schedules from the database and calls
* ScalingJobManager to delete scaling action jobs.
Expand Down
12 changes: 3 additions & 9 deletions style-guide/google-format-ci-v0.1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,16 @@ export PATH=${HOME}/go/bin:${PATH}
###################################################################################################
# This script downloads google formatter and displays formatting issues on Github actions
###################################################################################################
GOOGLE_JAR_VERSION=${GOOGLE_JAR_VERSION:-"1.11.0"}
GOOGLE_JAR_VERSION=${GOOGLE_JAR_VERSION:-"1.22.0"}
GOOGLE_JAR_NAME=${GOOGLE_JAR_NAME:-"google-java-format-${GOOGLE_JAR_VERSION}-all-deps.jar"}
! [ -e "$GOOGLE_JAR_NAME" ] && \
curl -fLJO "https://github.com/google/google-java-format/releases/download/v$GOOGLE_JAR_VERSION/$GOOGLE_JAR_NAME"
files_to_be_formatted=$(java \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
-jar "${GOOGLE_JAR_NAME}" -n --skip-javadoc-formatting $(find . -name '*.java') )

-jar "${GOOGLE_JAR_NAME}" --dry-run --skip-javadoc-formatting $(find src/scheduler -name '*.java') )

if [ -n "$files_to_be_formatted" ]; then
echo "Formatter Results..."
echo "Files require reformatting:"
echo "${files_to_be_formatted}"
exit 1
fi
fi

0 comments on commit 1473552

Please sign in to comment.