github-actions[bot] commented on PR #28989: URL: https://github.com/apache/doris/pull/28989#issuecomment-1869507333
#### `sh-checker report` To get the full details, please check in the [job]("https://github.com/apache/doris/actions/runs/7329471572") output. <details> <summary>shellcheck errors</summary> ``` 'shellcheck ' returned error 1 finding the following syntactical issues: ---------- In bin/start_fe.sh line 201: local os_type=$(uname -s) ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values. In bin/start_fe.sh line 203: local total_mem_byte="$(free -b | grep Mem | awk '{print $2}')" ^------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In bin/start_fe.sh line 204: local jvm_xmx_byte="$(${JAVA} ${final_java_opt} -XX:+PrintFlagsFinal -version 2>&1 | awk '/MaxHeapSize/ {print $4}')" ^----------^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local jvm_xmx_byte="$(${JAVA} "${final_java_opt}" -XX:+PrintFlagsFinal -version 2>&1 | awk '/MaxHeapSize/ {print $4}')" In bin/start_fe.sh line 205: local total_mem_mb=$(($total_mem_byte / 1024 / 1024)) ^-------------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. ^-------------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: local total_mem_mb=$((${total_mem_byte} / 1024 / 1024)) In bin/start_fe.sh line 206: local ninety_percent_mem_mb=$(($total_mem_byte / 10 * 9 / 1024 / 1024)) ^-------------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. ^-------------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^-- SC2017 (info): Increase precision by replacing a/b*c with a*c/b. Did you mean: local ninety_percent_mem_mb=$((${total_mem_byte} / 10 * 9 / 1024 / 1024)) In bin/start_fe.sh line 207: local jvm_xmx_mb=$(($jvm_xmx_byte / 1024 / 1024)) ^-----------^ SC2004 (style): $/${} is unnecessary on arithmetic variables. ^-----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: local jvm_xmx_mb=$((${jvm_xmx_byte} / 1024 / 1024)) In bin/start_fe.sh line 209: if [ ${jvm_xmx_mb} -gt ${ninety_percent_mem_mb} ]; then ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. ^-----------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters. ^----------------------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters. Did you mean: if [[ "${jvm_xmx_mb}" -gt "${ninety_percent_mem_mb}" ]]; then For more information: https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... https://www.shellcheck.net/wiki/SC2017 -- Increase precision by replacing a... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... ---------- You can address the above issues in one of three ways: 1. Manually correct the issue in the offending shell script; 2. Disable specific issues by adding the comment: # shellcheck disable=NNNN above the line that contains the issue, where NNNN is the error code; 3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file. ``` </details> <details> <summary>shfmt errors</summary> ``` 'shfmt ' returned error 1 finding the following formatting issues: ---------- --- bin/start_fe.sh.orig +++ bin/start_fe.sh @@ -209,7 +209,7 @@ if [ ${jvm_xmx_mb} -gt ${ninety_percent_mem_mb} ]; then echo "java opt -Xmx is more than 90% of total physical memory" echo "total_mem_mb:${total_mem_mb}MB ninety_percent_mem_mb:${ninety_percent_mem_mb}MB jvm_xmx_mb:${jvm_xmx_mb}MB" - exit 1; + exit 1 fi fi } ---------- You can reformat the above files to meet shfmt's requirements by typing: shfmt -w filename ``` </details> -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org