github-actions[bot] commented on PR #29764: URL: https://github.com/apache/doris/pull/29764#issuecomment-1884110134
#### `sh-checker report` To get the full details, please check in the [job]("https://github.com/apache/doris/actions/runs/7469722060") output. <details> <summary>shellcheck errors</summary> ``` 'shellcheck ' returned error 1 finding the following syntactical issues: ---------- In tools/pick_pr.sh line 18: remote_from=$(echo $branch_from | awk -F/ '{print $1}') ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: remote_from=$(echo "${branch_from}" | awk -F/ '{print $1}') In tools/pick_pr.sh line 21: branch_to_name=$(echo $branch_to | awk -F/ '{print $2}') ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: branch_to_name=$(echo "${branch_to}" | awk -F/ '{print $2}') In tools/pick_pr.sh line 22: remote_to=$(echo $branch_to | awk -F/ '{print $1}') ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: remote_to=$(echo "${branch_to}" | awk -F/ '{print $1}') In tools/pick_pr.sh line 25: push_url=$(git remote get-url --push $push_remote) ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: push_url=$(git remote get-url --push "${push_remote}") In tools/pick_pr.sh line 27: push_url=$(echo $push_url | sed 's|^https://github.com/||') ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: push_url=$(echo "${push_url}" | sed 's|^https://github.com/||') In tools/pick_pr.sh line 29: push_url=$(echo $push_url | sed 's|^g...@github.com:||') ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: push_url=$(echo "${push_url}" | sed 's|^g...@github.com:||') In tools/pick_pr.sh line 31: push_id=$(echo $push_url | awk -F/ '{print $1}') ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: push_id=$(echo "${push_url}" | awk -F/ '{print $1}') In tools/pick_pr.sh line 35: echo "step1: git fetch to update local git repos $remote_from and $remote_to" ^----------^ 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: echo "step1: git fetch to update local git repos ${remote_from} and ${remote_to}" In tools/pick_pr.sh line 36: git fetch $remote_from ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: git fetch "${remote_from}" In tools/pick_pr.sh line 37: git fetch $remote_to ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: git fetch "${remote_to}" In tools/pick_pr.sh line 40: echo "step2: get pr $pr commit id using gh cli" ^-^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "step2: get pr ${pr} commit id using gh cli" In tools/pick_pr.sh line 41: commitid=$(gh pr view $pr --repo $doris_repo --json mergeCommit -t '{{.mergeCommit.oid}}') ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^---------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters. ^---------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: commitid=$(gh pr view "${pr}" --repo "${doris_repo}" --json mergeCommit -t '{{.mergeCommit.oid}}') In tools/pick_pr.sh line 42: title=$(gh pr view $pr --repo $doris_repo --json title -t '{{.title}}') ^-^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^---------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters. ^---------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: title=$(gh pr view "${pr}" --repo "${doris_repo}" --json title -t '{{.title}}') In tools/pick_pr.sh line 43: echo "commit id for $pr is '$commitid'" ^-^ 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: echo "commit id for ${pr} is '${commitid}'" In tools/pick_pr.sh line 51: git show --stat $commitid ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: git show --stat "${commitid}" In tools/pick_pr.sh line 52: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In tools/pick_pr.sh line 53: echo "git show --stat $commitid failed, $commitid is invalid" ^-------^ 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: echo "git show --stat ${commitid} failed, ${commitid} is invalid" In tools/pick_pr.sh line 59: echo "step3: create local branch $branch_pick based on remote branch $branch_to" ^----------^ 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: echo "step3: create local branch ${branch_pick} based on remote branch ${branch_to}" In tools/pick_pr.sh line 60: branch_pick=$(echo pick_${pr}_to_${branch_to} | sed 's|/|_|g') ^---^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: branch_pick=$(echo pick_"${pr}"_to_"${branch_to}" | sed 's|/|_|g') In tools/pick_pr.sh line 61: git checkout -b $branch_pick ${branch_to} ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: git checkout -b "${branch_pick}" "${branch_to}" In tools/pick_pr.sh line 62: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In tools/pick_pr.sh line 63: echo "git checkout -b $branch_pick ${branch_to} failed" ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "git checkout -b ${branch_pick} ${branch_to} failed" In tools/pick_pr.sh line 69: echo -n "step4: will run git cherry-pick $commitid , please confirm y/n: " ^-- SC3037 (warning): In POSIX sh, echo flags are undefined. ^-------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo -n "step4: will run git cherry-pick ${commitid} , please confirm y/n: " In tools/pick_pr.sh line 71: read ans ^--^ SC2162 (info): read without -r will mangle backslashes. In tools/pick_pr.sh line 73: if [ "$ans" == "y" ]; then ^--^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^-- SC3014 (warning): In POSIX sh, == in place of = is undefined. Did you mean: if [ "${ans}" == "y" ]; then In tools/pick_pr.sh line 74: git cherry-pick $commitid ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: git cherry-pick "${commitid}" In tools/pick_pr.sh line 75: if [ $? -ne 0 ]; then ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?. In tools/pick_pr.sh line 76: echo -n "git cherry-pick return none zero $?, wait for manual processing, please confirm continue or exit c/e: " ^-- SC3037 (warning): In POSIX sh, echo flags are undefined. In tools/pick_pr.sh line 77: read ans ^--^ SC2162 (info): read without -r will mangle backslashes. In tools/pick_pr.sh line 78: if [ "$ans" != "c" ]; then ^--^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if [ "${ans}" != "c" ]; then In tools/pick_pr.sh line 79: echo "manual processing confirm $ans is not c, git cherry-pick --abort and exit now" ^--^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "manual processing confirm ${ans} is not c, git cherry-pick --abort and exit now" In tools/pick_pr.sh line 86: echo "step5: push to your remote repo $push_remote $(git remote get-url --push $push_remote)" ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "step5: push to your remote repo ${push_remote} $(git remote get-url --push "${push_remote}")" In tools/pick_pr.sh line 87: git push $push_remote ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: git push "${push_remote}" In tools/pick_pr.sh line 91: newpr_url=$(gh pr create --repo $doris_repo --base $branch_to_name --head ${push_id}:${branch_pick} --title "$title #${pr}" --body "cherry pick from #${pr}") ^---------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters. ^---------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: newpr_url=$(gh pr create --repo "${doris_repo}" --base "${branch_to_name}" --head "${push_id}":"${branch_pick}" --title "${title} #${pr}" --body "cherry pick from #${pr}") In tools/pick_pr.sh line 92: echo "new pr url: $newpr_url" ^--------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "new pr url: ${newpr_url}" In tools/pick_pr.sh line 96: newpr=$(echo $newpr_url | awk -F/ '{print $NF}') ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: newpr=$(echo "${newpr_url}" | awk -F/ '{print $NF}') In tools/pick_pr.sh line 97: if [ "$newpr" != "" ]; then ^----^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: if [ "${newpr}" != "" ]; then In tools/pick_pr.sh line 98: gh pr comment --repo $doris_repo $newpr --body 'run buildall' ^---------^ SC2248 (style): Prefer double quoting even when variables don't contain special characters. ^---------^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: gh pr comment --repo "${doris_repo}" "${newpr}" --body 'run buildall' In tools/pick_pr.sh line 101: echo "do nothing for $pr" ^-^ SC2250 (style): Prefer putting braces around variable references even when not strictly required. Did you mean: echo "do nothing for ${pr}" For more information: https://www.shellcheck.net/wiki/SC3014 -- In POSIX sh, == in place of = is ... https://www.shellcheck.net/wiki/SC3037 -- In POSIX sh, echo flags are undef... 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 ' found no issues. ``` </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