This is an automated email from the ASF dual-hosted git repository. nihaljain pushed a commit to branch 5.2 in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/5.2 by this push: new 7bb644ddb4 PHOENIX-7443 Add Spotless to the pre-commit checks (#2119) (#2260) 7bb644ddb4 is described below commit 7bb644ddb437a792243306676ccc03991fbfb10b Author: Nihal Jain <nihalj...@apache.org> AuthorDate: Wed Aug 6 14:31:00 2025 +0530 PHOENIX-7443 Add Spotless to the pre-commit checks (#2119) (#2260) --- dev/phoenix-personality.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/dev/phoenix-personality.sh b/dev/phoenix-personality.sh index 706cfb85b3..772a8eb8f3 100755 --- a/dev/phoenix-personality.sh +++ b/dev/phoenix-personality.sh @@ -419,3 +419,54 @@ function hbase_javac_logfilter ${GREP} -E '\[(ERROR|WARNING)\] /.*\.java:' "${input}" | sort > "${output}" } + +###################################### +# Below plugin is copied from https://github.com/apache/hbase/blob/master/dev-support/hbase-personality.sh +###################################### + +add_test_type spotless + +## @description spotless file filter +## @audience private +## @stability evolving +## @param filename +function spotless_filefilter +{ + # always add spotless check as it can format almost all types of files + add_test spotless +} +## @description run spotless:check to check format issues +## @audience private +## @stability evolving +## @param repostatus +function spotless_rebuild +{ + local repostatus=$1 + local logfile="${PATCH_DIR}/${repostatus}-spotless.txt" + + if ! verify_needed_test spotless; then + return 0 + fi + + big_console_header "Checking spotless on ${repostatus}" + + start_clock + + local -a maven_args=('spotless:check') + + # disabled because "maven_executor" needs to return both command and args + # shellcheck disable=2046 + echo_and_redirect "${logfile}" $(maven_executor) "${maven_args[@]}" + + count=$(${GREP} -c '\[ERROR\]' "${logfile}") + if [[ ${count} -gt 0 ]]; then + add_vote_table -1 spotless "${repostatus} has ${count} errors when running spotless:check, run spotless:apply to fix." + add_footer_table spotless "@@BASE@@/${repostatus}-spotless.txt" + return 1 + fi + + add_vote_table +1 spotless "${repostatus} has no errors when running spotless:check." + return 0 +} + +######################################