github-actions[bot] commented on PR #34418: URL: https://github.com/apache/doris/pull/34418#issuecomment-2100609089
#### `sh-checker report` To get the full details, please check in the [job]("https://github.com/apache/doris/actions/runs/9002882105") output. <details> <summary>shellcheck errors</summary> ``` 'shellcheck ' returned error 1 finding the following syntactical issues: ---------- In regression-test/suites/nereids_tpcds_shape_sf100_p0/code3.sh line 4: if [ $# -eq 0 ]; then ^----------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. Did you mean: if [[ $# -eq 0 ]]; then In regression-test/suites/nereids_tpcds_shape_sf100_p0/code3.sh line 13: if [ ! -f "$input_file" ]; then ^--------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. ^---------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if [[ ! -f "${input_file}" ]]; then In regression-test/suites/nereids_tpcds_shape_sf100_p0/code3.sh line 14: echo "File '$input_file' does not exist." ^---------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "File '${input_file}' does not exist." In regression-test/suites/nereids_tpcds_shape_sf100_p0/code3.sh line 19: if grep -q "sql \"set disable_nereids_rules=PRUNE_EMPTY_PARTITION\"" "$input_file"; then ^---------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if grep -q "sql \"set disable_nereids_rules=PRUNE_EMPTY_PARTITION\"" "${input_file}"; then In regression-test/suites/nereids_tpcds_shape_sf100_p0/code3.sh line 23: awk '/sql '\''SET enable_pipeline_engine = true'\''/ { print; print " sql \"set disable_nereids_rules=PRUNE_EMPTY_PARTITION\""; next } 1' "$input_file" > temp_file && mv temp_file "$input_file" ^---------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^---------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: awk '/sql '\''SET enable_pipeline_engine = true'\''/ { print; print " sql \"set disable_nereids_rules=PRUNE_EMPTY_PARTITION\""; next } 1' "${input_file}" > temp_file && mv temp_file "${input_file}" In regression-test/suites/nereids_tpcds_shape_sf100_p0/traverse_dir.sh line 4: if [ $# -eq 0 ]; then ^----------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. Did you mean: if [[ $# -eq 0 ]]; then In regression-test/suites/nereids_tpcds_shape_sf100_p0/traverse_dir.sh line 13: if [ ! -d "$directory" ]; then ^-------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. ^--------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if [[ ! -d "${directory}" ]]; then In regression-test/suites/nereids_tpcds_shape_sf100_p0/traverse_dir.sh line 14: echo "Directory '$directory' does not exist." ^--------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "Directory '${directory}' does not exist." In regression-test/suites/nereids_tpcds_shape_sf100_p0/traverse_dir.sh line 19: for file in "$directory"/*; do ^--------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: for file in "${directory}"/*; do In regression-test/suites/nereids_tpcds_shape_sf100_p0/traverse_dir.sh line 21: if [ -f "$file" ]; then ^------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh. ^---^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if [[ -f "${file}" ]]; then In regression-test/suites/nereids_tpcds_shape_sf100_p0/traverse_dir.sh line 23: echo "Processing file: $file" ^---^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "Processing file: ${file}" In regression-test/suites/nereids_tpcds_shape_sf100_p0/traverse_dir.sh line 25: bash code3.sh "$file" # 调用之前的脚本对单个文件执行操作 ^---^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: bash code3.sh "${file}" # 调用之前的脚本对单个文件执行操作 For more information: https://www.shellcheck.net/wiki/SC2250 -- Prefer putting braces around vari... https://www.shellcheck.net/wiki/SC2292 -- Prefer [[ ]] over [ ] for tests i... ---------- 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: ---------- --- regression-test/suites/nereids_tpcds_shape_sf100_p0/code3.sh.orig +++ regression-test/suites/nereids_tpcds_shape_sf100_p0/code3.sh @@ -20,7 +20,6 @@ echo "Line already exists. Skipping addition." else # 使用awk命令在文件中查找并添加行 - awk '/sql '\''SET enable_pipeline_engine = true'\''/ { print; print " sql \"set disable_nereids_rules=PRUNE_EMPTY_PARTITION\""; next } 1' "$input_file" > temp_file && mv temp_file "$input_file" + awk '/sql '\''SET enable_pipeline_engine = true'\''/ { print; print " sql \"set disable_nereids_rules=PRUNE_EMPTY_PARTITION\""; next } 1' "$input_file" >temp_file && mv temp_file "$input_file" echo "Line added successfully." fi - --- regression-test/suites/nereids_tpcds_shape_sf100_p0/traverse_dir.sh.orig +++ regression-test/suites/nereids_tpcds_shape_sf100_p0/traverse_dir.sh @@ -22,7 +22,6 @@ # 执行操作 echo "Processing file: $file" # 在这里执行对单个文件的操作 - bash code3.sh "$file" # 调用之前的脚本对单个文件执行操作 + bash code3.sh "$file" # 调用之前的脚本对单个文件执行操作 fi done - ---------- 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