github-actions[bot] commented on code in PR #64497:
URL: https://github.com/apache/doris/pull/64497#discussion_r3421727582
##########
build-support/check-format.sh:
##########
@@ -31,19 +31,19 @@ DORIS_HOME=$(
)
export DORIS_HOME
-if [[ -z $(command -v clang-format) ]]; then
+CLANG_FORMAT="${CLANG_FORMAT_BINARY:=$(command -v clang-format)}"
Review Comment:
With `set -e`, this assignment exits before the following not-found check
whenever neither `CLANG_FORMAT_BINARY` nor `clang-format` is available. I
reproduced it by running both scripts with a PATH that contains
`dirname`/`perl`/`uname` but no `clang-format`: they exit 1 with empty
stdout/stderr instead of printing `clang-format not found`. The override case
is fixed, but this no-override failure path regressed. Please avoid running
`command -v` in the default expansion and let the existing check handle lookup,
then apply the same change to `build-support/clang-format.sh`.
```suggestion
CLANG_FORMAT="${CLANG_FORMAT_BINARY:-clang-format}"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]