github-actions[bot] commented on PR #39803:
URL: https://github.com/apache/doris/pull/39803#issuecomment-2304670903
#### `sh-checker report`
To get the full details, please check in the
[job]("https://github.com/apache/doris/actions/runs/10509011770") output.
<details>
<summary>shellcheck errors</summary>
```
'shellcheck ' returned error 1 finding the following syntactical issues:
----------
In tools/fdb/fdb_ctrl.sh line 5:
ROOT_DIR="$(cd "$(dirname $(readlink -f ${BASH_SOURCE[0]}))" &>/dev/null &&
pwd)"
^-- SC2046 (warning): Quote this to prevent word
splitting.
^---------------^ SC2086 (info):
Double quote to prevent globbing and word splitting.
Did you mean:
ROOT_DIR="$(cd "$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" &>/dev/null
&& pwd)"
In tools/fdb/fdb_ctrl.sh line 7:
if [ -f ${ROOT_DIR}/fdb_vars.sh ]; then
^----------------------------^ SC2292 (style): Prefer [[ ]] over [ ] for
tests in Bash/Ksh.
^---------^ SC2086 (info): Double quote to prevent globbing and word
splitting.
Did you mean:
if [[ -f "${ROOT_DIR}"/fdb_vars.sh ]]; then
In tools/fdb/fdb_ctrl.sh line 8:
source ${ROOT_DIR}/fdb_vars.sh
^---------^ SC2086 (info): Double quote to prevent globbing and
word splitting.
Did you mean:
source "${ROOT_DIR}"/fdb_vars.sh
In tools/fdb/fdb_ctrl.sh line 14:
if [ ! -d ${FDB_HOME} ]; then
^------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in
Bash/Ksh.
^---------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
if [[ ! -d "${FDB_HOME}" ]]; then
In tools/fdb/fdb_ctrl.sh line 20:
echo "$FDB_HOME is not an absolute path."
^-------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
echo "${FDB_HOME} is not an absolute path."
In tools/fdb/fdb_ctrl.sh line 24:
if [ -z ${FDB_CLUSTER_ID} ]; then
^----------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests
in Bash/Ksh.
^---------------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
if [[ -z "${FDB_CLUSTER_ID}" ]]; then
In tools/fdb/fdb_ctrl.sh line 40:
mkdir -p ${LOG_DIR}
^--------^ SC2086 (info): Double quote to prevent globbing and word
splitting.
Did you mean:
mkdir -p "${LOG_DIR}"
In tools/fdb/fdb_ctrl.sh line 41:
mkdir -p ${FDB_HOME}/conf
^---------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
mkdir -p "${FDB_HOME}"/conf
In tools/fdb/fdb_ctrl.sh line 42:
mkdir -p ${FDB_HOME}/log
^---------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
mkdir -p "${FDB_HOME}"/log
In tools/fdb/fdb_ctrl.sh line 48:
if lsof -nP -iTCP:${port} -sTCP:LISTEN >/dev/null; then
^-----^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
if lsof -nP -iTCP:"${port}" -sTCP:LISTEN >/dev/null; then
In tools/fdb/fdb_ctrl.sh line 55:
if [ -d ${FDB_PKG_DIR} ]; then
^-------------------^ SC2292 (style): Prefer [[ ]] over [ ] for tests
in Bash/Ksh.
^------------^ SC2086 (info): Double quote to prevent globbing
and word splitting.
Did you mean:
if [[ -d "${FDB_PKG_DIR}" ]]; then
In tools/fdb/fdb_ctrl.sh line 63:
rm -rf ${TMP}
^----^ SC2086 (info): Double quote to prevent globbing and word
splitting.
Did you mean:
rm -rf "${TMP}"
In tools/fdb/fdb_ctrl.sh line 64:
mkdir -p ${TMP}
^----^ SC2086 (info): Double quote to prevent globbing and word
splitting.
Did you mean:
mkdir -p "${TMP}"
In tools/fdb/fdb_ctrl.sh line 66:
wget ${URL}/fdbbackup.x86_64 -O ${TMP}/fdbbackup
^----^ SC2248 (style): Prefer double quoting even when variables
don't contain special characters.
^----^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
wget "${URL}"/fdbbackup.x86_64 -O "${TMP}"/fdbbackup
In tools/fdb/fdb_ctrl.sh line 67:
wget ${URL}/fdbserver.x86_64 -O ${TMP}/fdbserver
^----^ SC2248 (style): Prefer double quoting even when variables
don't contain special characters.
^----^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
wget "${URL}"/fdbserver.x86_64 -O "${TMP}"/fdbserver
In tools/fdb/fdb_ctrl.sh line 68:
wget ${URL}/fdbcli.x86_64 -O ${TMP}/fdbcli
^----^ SC2248 (style): Prefer double quoting even when variables
don't contain special characters.
^----^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
wget "${URL}"/fdbcli.x86_64 -O "${TMP}"/fdbcli
In tools/fdb/fdb_ctrl.sh line 69:
wget ${URL}/fdbmonitor.x86_64 -O ${TMP}/fdbmonitor
^----^ SC2248 (style): Prefer double quoting even when variables
don't contain special characters.
^----^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
wget "${URL}"/fdbmonitor.x86_64 -O "${TMP}"/fdbmonitor
In tools/fdb/fdb_ctrl.sh line 70:
wget ${URL}/libfdb_c.x86_64.so -O ${TMP}/libfdb_c.x86_64.so
^----^ SC2248 (style): Prefer double quoting even when variables
don't contain special characters.
^----^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
wget "${URL}"/libfdb_c.x86_64.so -O "${TMP}"/libfdb_c.x86_64.so
In tools/fdb/fdb_ctrl.sh line 71:
chmod +x ${TMP}/fdb*
^----^ SC2086 (info): Double quote to prevent globbing and word
splitting.
Did you mean:
chmod +x "${TMP}"/fdb*
In tools/fdb/fdb_ctrl.sh line 73:
mv ${TMP} ${FDB_PKG_DIR}
^----^ SC2086 (info): Double quote to prevent globbing and word
splitting.
^------------^ SC2086 (info): Double quote to prevent globbing
and word splitting.
Did you mean:
mv "${TMP}" "${FDB_PKG_DIR}"
In tools/fdb/fdb_ctrl.sh line 79:
local num_nodes=$(echo "$FDB_CLUSTER_IPS" | tr ',' '\n' | wc -l)
^-------^ SC2155 (warning): Declare and assign separately to avoid
masking return values.
^--------------^ SC2250 (style): Prefer putting
braces around variable references even when not strictly required.
Did you mean:
local num_nodes=$(echo "${FDB_CLUSTER_IPS}" | tr ',' '\n' | wc -l)
In tools/fdb/fdb_ctrl.sh line 82:
if [[ $num_nodes -le 2 ]]; then
^--------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
if [[ ${num_nodes} -le 2 ]]; then
In tools/fdb/fdb_ctrl.sh line 84:
elif [[ $num_nodes -le 4 ]]; then
^--------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
elif [[ ${num_nodes} -le 4 ]]; then
In tools/fdb/fdb_ctrl.sh line 90:
echo $FDB_CLUSTER_IPS | cut -d',' -f1-$num_coordinators | tr ',' '\n' |
sed "s/$/:$FDB_PORT/" | paste -sd ','
^--------------^ 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.
^---------------^ 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.
^-------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
echo "${FDB_CLUSTER_IPS}" | cut -d',' -f1-"${num_coordinators}" | tr ','
'\n' | sed "s/$/:${FDB_PORT}/" | paste -sd ','
In tools/fdb/fdb_ctrl.sh line 95:
local num_nodes=$(echo "$FDB_CLUSTER_IPS" | tr ',' '\n' | wc -l)
^-------^ SC2155 (warning): Declare and assign separately to avoid
masking return values.
^--------------^ SC2250 (style): Prefer putting
braces around variable references even when not strictly required.
Did you mean:
local num_nodes=$(echo "${FDB_CLUSTER_IPS}" | tr ',' '\n' | wc -l)
In tools/fdb/fdb_ctrl.sh line 98:
if [[ $num_nodes -eq 1 ]]; then
^--------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
if [[ ${num_nodes} -eq 1 ]]; then
In tools/fdb/fdb_ctrl.sh line 100:
elif [[ $num_nodes -le 4 ]]; then
^--------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
elif [[ ${num_nodes} -le 4 ]]; then
In tools/fdb/fdb_ctrl.sh line 106:
echo $fdb_mode
^-------^ 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:
echo "${fdb_mode}"
In tools/fdb/fdb_ctrl.sh line 111:
local memory_gb=$1
^-------^ SC2034 (warning): memory_gb appears unused. Verify use
(or export if used externally).
In tools/fdb/fdb_ctrl.sh line 118:
IFS=',' read -r -a DATA_DIR_ARRAY <<< "$DATA_DIRS"
^--------^ SC2250 (style): Prefer
putting braces around variable references even when not strictly required.
Did you mean:
IFS=',' read -r -a DATA_DIR_ARRAY <<< "${DATA_DIRS}"
In tools/fdb/fdb_ctrl.sh line 123:
[[ $STATLESS_PROCESSES -lt $min_processes ]] &&
STATLESS_PROCESSES=$min_processes
^-----------------^ 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.
^------------^ SC2250 (style): Prefer putting braces around variable references
even when not strictly required.
Did you mean:
[[ ${STATLESS_PROCESSES} -lt ${min_processes} ]] &&
STATLESS_PROCESSES=${min_processes}
In tools/fdb/fdb_ctrl.sh line 127:
[[ $STORAGE_PROCESSES -lt $data_dir_count ]] &&
STORAGE_PROCESSES=$data_dir_count
^----------------^ 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.
^-------------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
[[ ${STORAGE_PROCESSES} -lt ${data_dir_count} ]] &&
STORAGE_PROCESSES=${data_dir_count}
In tools/fdb/fdb_ctrl.sh line 132:
[[ $TRANSACTION_PROCESSES -lt $min_processes ]] &&
TRANSACTION_PROCESSES=$min_processes
^--------------------^ 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.
^------------^ SC2250 (style): Prefer putting braces around variable references
even when not strictly required.
Did you mean:
[[ ${TRANSACTION_PROCESSES} -lt ${min_processes} ]] &&
TRANSACTION_PROCESSES=${min_processes}
In tools/fdb/fdb_ctrl.sh line 133:
[[ $TRANSACTION_PROCESSES -lt $data_dir_count ]] &&
TRANSACTION_PROCESSES=$data_dir_count
^--------------------^ 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.
^-------------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
[[ ${TRANSACTION_PROCESSES} -lt ${data_dir_count} ]] &&
TRANSACTION_PROCESSES=${data_dir_count}
In tools/fdb/fdb_ctrl.sh line 136:
echo "Stateless Processes: $STATLESS_PROCESSES"
^-----------------^ SC2250 (style): Prefer
putting braces around variable references even when not strictly required.
Did you mean:
echo "Stateless Processes: ${STATLESS_PROCESSES}"
In tools/fdb/fdb_ctrl.sh line 137:
echo "Storage Processes: $STORAGE_PROCESSES"
^----------------^ SC2250 (style): Prefer
putting braces around variable references even when not strictly required.
Did you mean:
echo "Storage Processes: ${STORAGE_PROCESSES}"
In tools/fdb/fdb_ctrl.sh line 138:
echo "Transaction Processes: $TRANSACTION_PROCESSES"
^--------------------^ SC2250 (style):
Prefer putting braces around variable references even when not strictly
required.
Did you mean:
echo "Transaction Processes: ${TRANSACTION_PROCESSES}"
In tools/fdb/fdb_ctrl.sh line 144:
ln -sf ${FDB_PKG_DIR}/fdbserver ${FDB_HOME}/fdbserver
^------------^ SC2086 (info): Double quote to prevent globbing
and word splitting.
^---------^ SC2248 (style): Prefer
double quoting even when variables don't contain special characters.
Did you mean:
ln -sf "${FDB_PKG_DIR}"/fdbserver "${FDB_HOME}"/fdbserver
In tools/fdb/fdb_ctrl.sh line 145:
ln -sf ${FDB_PKG_DIR}/fdbmonitor ${FDB_HOME}/fdbmonitor
^------------^ SC2086 (info): Double quote to prevent globbing
and word splitting.
^---------^ SC2248 (style): Prefer
double quoting even when variables don't contain special characters.
Did you mean:
ln -sf "${FDB_PKG_DIR}"/fdbmonitor "${FDB_HOME}"/fdbmonitor
In tools/fdb/fdb_ctrl.sh line 146:
ln -sf ${FDB_PKG_DIR}/fdbbackup ${FDB_HOME}/backup_agent
^------------^ SC2086 (info): Double quote to prevent globbing
and word splitting.
^---------^ SC2248 (style): Prefer
double quoting even when variables don't contain special characters.
Did you mean:
ln -sf "${FDB_PKG_DIR}"/fdbbackup "${FDB_HOME}"/backup_agent
In tools/fdb/fdb_ctrl.sh line 147:
ln -sf ${FDB_PKG_DIR}/fdbcli ${FDB_HOME}/fdbcli
^------------^ SC2086 (info): Double quote to prevent globbing
and word splitting.
^---------^ SC2248 (style): Prefer double
quoting even when variables don't contain special characters.
Did you mean:
ln -sf "${FDB_PKG_DIR}"/fdbcli "${FDB_HOME}"/fdbcli
In tools/fdb/fdb_ctrl.sh line 149:
CLUSTER_DESC=${FDB_CLUSTER_DESC:-$FDB_CLUSTER_ID}
^-------------^ SC2250 (style): Prefer
putting braces around variable references even when not strictly required.
Did you mean:
CLUSTER_DESC=${FDB_CLUSTER_DESC:-${FDB_CLUSTER_ID}}
In tools/fdb/fdb_ctrl.sh line 152:
IFS=',' read -r -a DATA_DIR_ARRAY <<< "$DATA_DIRS"
^--------^ SC2250 (style): Prefer
putting braces around variable references even when not strictly required.
Did you mean:
IFS=',' read -r -a DATA_DIR_ARRAY <<< "${DATA_DIRS}"
In tools/fdb/fdb_ctrl.sh line 154:
mkdir -p $DIR || handle_error "Failed to create data directory $DIR"
^--^ SC2086 (info): Double quote to prevent globbing and
word splitting.
^--^ 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:
mkdir -p "${DIR}" || handle_error "Failed to create data directory
${DIR}"
In tools/fdb/fdb_ctrl.sh line 159:
cat >${FDB_HOME}/conf/fdb.cluster <<EOF
^---------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
cat >"${FDB_HOME}"/conf/fdb.cluster <<EOF
In tools/fdb/fdb_ctrl.sh line 163:
cat >${FDB_HOME}/conf/fdb.conf <<EOF
^---------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
cat >"${FDB_HOME}"/conf/fdb.conf <<EOF
In tools/fdb/fdb_ctrl.sh line 187:
calculate_process_numbers $MEMORY_LIMIT_GB $CPU_CORES_LIMIT
^--------------^ 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.
^--------------^ SC2250
(style): Prefer putting braces around variable references even when not
strictly required.
Did you mean:
calculate_process_numbers "${MEMORY_LIMIT_GB}" "${CPU_CORES_LIMIT}"
In tools/fdb/fdb_ctrl.sh line 192:
echo "[fdbserver.$PORT]
^---^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
echo "[fdbserver.${PORT}]
In tools/fdb/fdb_ctrl.sh line 193:
class = stateless" | tee -a ${FDB_HOME}/conf/fdb.conf > /dev/null
^---------^ SC2248 (style): Prefer double
quoting even when variables don't contain special characters.
Did you mean:
class = stateless" | tee -a "${FDB_HOME}"/conf/fdb.conf > /dev/null
In tools/fdb/fdb_ctrl.sh line 203:
echo "[fdbserver.$PORT]
^---^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
echo "[fdbserver.${PORT}]
In tools/fdb/fdb_ctrl.sh line 205:
datadir = ${DATA_DIR_ARRAY[$DIR_INDEX]}/$PORT" | tee -a
${FDB_HOME}/conf/fdb.conf > /dev/null
^--------^ 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.
^---------^ SC2248
(style): Prefer double quoting even when variables don't contain special
characters.
Did you mean:
datadir = ${DATA_DIR_ARRAY[${DIR_INDEX}]}/${PORT}" | tee -a
"${FDB_HOME}"/conf/fdb.conf > /dev/null
In tools/fdb/fdb_ctrl.sh line 214:
echo "[fdbserver.$PORT]
^---^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
echo "[fdbserver.${PORT}]
In tools/fdb/fdb_ctrl.sh line 216:
datadir = ${DATA_DIR_ARRAY[$DIR_INDEX]}/$PORT" | tee -a
${FDB_HOME}/conf/fdb.conf > /dev/null
^--------^ 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.
^---------^ SC2248
(style): Prefer double quoting even when variables don't contain special
characters.
Did you mean:
datadir = ${DATA_DIR_ARRAY[${DIR_INDEX}]}/${PORT}" | tee -a
"${FDB_HOME}"/conf/fdb.conf > /dev/null
In tools/fdb/fdb_ctrl.sh line 221:
logdir = ${LOG_DIR}" | tee -a ${FDB_HOME}/conf/fdb.conf > /dev/null
^---------^ SC2248 (style): Prefer double
quoting even when variables don't contain special characters.
Did you mean:
logdir = ${LOG_DIR}" | tee -a "${FDB_HOME}"/conf/fdb.conf > /dev/null
In tools/fdb/fdb_ctrl.sh line 227:
if [ ! -f ${FDB_HOME}/fdbmonitor ]; then
^-----------------------------^ SC2292 (style): Prefer [[ ]] over [ ]
for tests in Bash/Ksh.
^---------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
if [[ ! -f "${FDB_HOME}"/fdbmonitor ]]; then
In tools/fdb/fdb_ctrl.sh line 232:
ensure_port_is_listenable "fdbserver" ${FDB_PORT}
^---------^ SC2086 (info): Double
quote to prevent globbing and word splitting.
Did you mean:
ensure_port_is_listenable "fdbserver" "${FDB_PORT}"
In tools/fdb/fdb_ctrl.sh line 235:
${FDB_HOME}/fdbmonitor \
^---------^ SC2248 (style): Prefer double quoting even when variables
don't contain special characters.
Did you mean:
"${FDB_HOME}"/fdbmonitor \
In tools/fdb/fdb_ctrl.sh line 236:
--conffile ${FDB_HOME}/conf/fdb.conf \
^---------^ SC2248 (style): Prefer double quoting even
when variables don't contain special characters.
Did you mean:
--conffile "${FDB_HOME}"/conf/fdb.conf \
In tools/fdb/fdb_ctrl.sh line 237:
--lockfile ${FDB_HOME}/fdbmonitor.pid \
^---------^ SC2248 (style): Prefer double quoting even
when variables don't contain special characters.
Did you mean:
--lockfile "${FDB_HOME}"/fdbmonitor.pid \
In tools/fdb/fdb_ctrl.sh line 242:
if [ -f ${FDB_HOME}/fdbmonitor.pid ]; then
^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
^---------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
if [[ -f "${FDB_HOME}"/fdbmonitor.pid ]]; then
In tools/fdb/fdb_ctrl.sh line 243:
local fdb_pid=$(cat ${FDB_HOME}/fdbmonitor.pid)
^-----^ SC2155 (warning): Declare and assign separately to
avoid masking return values.
^---------^ SC2248 (style): Prefer double
quoting even when variables don't contain special characters.
Did you mean:
local fdb_pid=$(cat "${FDB_HOME}"/fdbmonitor.pid)
In tools/fdb/fdb_ctrl.sh line 244:
if ps -p ${fdb_pid} >/dev/null; then
^--------^ SC2086 (info): Double quote to prevent globbing
and word splitting.
Did you mean:
if ps -p "${fdb_pid}" >/dev/null; then
In tools/fdb/fdb_ctrl.sh line 246:
kill -9 ${fdb_pid}
^--------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
kill -9 "${fdb_pid}"
In tools/fdb/fdb_ctrl.sh line 252:
if [ -f ${FDB_HOME}/fdbmonitor.pid ]; then
^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
^---------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
if [[ -f "${FDB_HOME}"/fdbmonitor.pid ]]; then
In tools/fdb/fdb_ctrl.sh line 253:
local fdb_pid=$(cat ${FDB_HOME}/fdbmonitor.pid)
^-----^ SC2155 (warning): Declare and assign separately to
avoid masking return values.
^---------^ SC2248 (style): Prefer double
quoting even when variables don't contain special characters.
Did you mean:
local fdb_pid=$(cat "${FDB_HOME}"/fdbmonitor.pid)
In tools/fdb/fdb_ctrl.sh line 254:
if ps -p ${fdb_pid} >/dev/null; then
^--------^ SC2086 (info): Double quote to prevent globbing
and word splitting.
Did you mean:
if ps -p "${fdb_pid}" >/dev/null; then
In tools/fdb/fdb_ctrl.sh line 261:
rm -rf ${FDB_HOME}/*
^-----------^ SC2115 (warning): Use "${var:?}" to ensure this
never expands to /* .
^---------^ SC2248 (style): Prefer double quoting even when
variables don't contain special characters.
Did you mean:
rm -rf "${FDB_HOME}"/*
In tools/fdb/fdb_ctrl.sh line 269:
if [[ $job =~ ^(all|fdb)$ ]]; then
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
if [[ ${job} =~ ^(all|fdb)$ ]]; then
In tools/fdb/fdb_ctrl.sh line 278:
if [[ $job =~ ^(all|fdb)$ ]]; then
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
if [[ ${job} =~ ^(all|fdb)$ ]]; then
In tools/fdb/fdb_ctrl.sh line 282:
if [[ $init =~ ^(all|fdb)$ ]]; then
^---^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
if [[ ${init} =~ ^(all|fdb)$ ]]; then
In tools/fdb/fdb_ctrl.sh line 284:
local fdb_mode=$(get_fdb_mode)
^------^ SC2155 (warning): Declare and assign separately to
avoid masking return values.
In tools/fdb/fdb_ctrl.sh line 285:
${FDB_HOME}/fdbcli -C ${FDB_HOME}/conf/fdb.cluster \
^---------^ 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:
"${FDB_HOME}"/fdbcli -C "${FDB_HOME}"/conf/fdb.cluster \
In tools/fdb/fdb_ctrl.sh line 293:
if [[ $job =~ ^(all|fdb)$ ]]; then
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
if [[ ${job} =~ ^(all|fdb)$ ]]; then
In tools/fdb/fdb_ctrl.sh line 302:
if [[ $job =~ ^(all|fdb)$ ]]; then
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
if [[ ${job} =~ ^(all|fdb)$ ]]; then
In tools/fdb/fdb_ctrl.sh line 309:
ps -ef | grep ${FDB_CLUSTER_DESC} | grep -v grep
^----^ SC2009 (info): Consider using pgrep instead of grepping ps output.
^-----------------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
ps -ef | grep "${FDB_CLUSTER_DESC}" | grep -v grep
In tools/fdb/fdb_ctrl.sh line 330:
echo "Unknown cmd: ${cmd}\n"
^---------------------^ SC2028 (info): echo may not expand escape
sequences. Use printf.
In tools/fdb/fdb_ctrl.sh line 334:
if [[ $# < 1 ]]; then
^-- SC2071 (error): < is for string comparisons. Use -lt instead.
In tools/fdb/fdb_ctrl.sh line 347:
case $cmd in
^--^ SC2250 (style): Prefer putting braces around variable references
even when not strictly required.
Did you mean:
case ${cmd} in
In tools/fdb/fdb_ctrl.sh line 349:
deploy "$job" $skip_pkg $skip_config
^--^ 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.
^----------^ 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:
deploy "${job}" "${skip_pkg}" "${skip_config}"
In tools/fdb/fdb_ctrl.sh line 352:
start "$job" "${init}"
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
start "${job}" "${init}"
In tools/fdb/fdb_ctrl.sh line 355:
stop "$job"
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
stop "${job}"
In tools/fdb/fdb_ctrl.sh line 358:
clean "$job"
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
clean "${job}"
In tools/fdb/fdb_ctrl.sh line 361:
${FDB_HOME}/fdbcli -C ${FDB_HOME}/conf/fdb.cluster $@
^---------^ 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.
^-- SC2068
(error): Double quote array expansions to avoid re-splitting elements.
Did you mean:
"${FDB_HOME}"/fdbcli -C "${FDB_HOME}"/conf/fdb.cluster $@
In tools/fdb/fdb_ctrl.sh line 365:
mysql -uroot -h127.0.0.1 -P$(fe_query_port 0)
^----------------^ SC2046 (warning):
Quote this to prevent word splitting.
In tools/fdb/fdb_ctrl.sh line 372:
run_regression $skip_config $@
^----------^ 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.
^-- SC2068 (error): Double quote array
expansions to avoid re-splitting elements.
Did you mean:
run_regression "${skip_config}" $@
In tools/fdb/fdb_ctrl.sh line 378:
unknown_cmd $cmd
^--^ 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:
unknown_cmd "${cmd}"
In tools/fdb/fdb_vars.sh line 1:
# Description: Variables for FoundationDB
^-- SC2148 (error): Tips depend on target shell and yours is unknown. Add a
shebang or a 'shell' directive.
In tools/fdb/fdb_vars.sh line 5:
FDB_PORT=4500
^------^ SC2034 (warning): FDB_PORT appears unused. Verify use (or export if
used externally).
In tools/fdb/fdb_vars.sh line 9:
DATA_DIRS="/var/lib/foundationdb/data1,/var/lib/foundationdb/data2,/var/lib/foundationdb/data3"
^-------^ SC2034 (warning): DATA_DIRS appears unused. Verify use (or export
if used externally).
In tools/fdb/fdb_vars.sh line 12:
FDB_CLUSTER_IPS="172.200.0.2,172.200.0.3,172.200.0.4"
^-------------^ SC2034 (warning): FDB_CLUSTER_IPS appears unused. Verify use
(or export if used externally).
In tools/fdb/fdb_vars.sh line 21:
MEMORY_LIMIT_GB=16
^-------------^ SC2034 (warning): MEMORY_LIMIT_GB appears unused. Verify use
(or export if used externally).
In tools/fdb/fdb_vars.sh line 24:
CPU_CORES_LIMIT=8
^-------------^ SC2034 (warning): CPU_CORES_LIMIT appears unused. Verify use
(or export if used externally).
In tools/fdb/fdb_vars.sh line 27:
FDB_CLUSTER_DESC="mycluster"
^--------------^ SC2034 (warning): FDB_CLUSTER_DESC appears unused. Verify
use (or export if used externally).
In tools/fdb/fdb_vars.sh line 30:
FDB_CLUSTER_ID="SAQESzbh"
^------------^ SC2034 (warning): FDB_CLUSTER_ID appears unused. Verify use
(or export if used externally).
In tools/fdb/fdb_vars.sh line 33:
FDB_VERSION="7.1.38"
^---------^ SC2034 (warning): FDB_VERSION appears unused. Verify use (or
export if used externally).
In tools/fdb/fdb_vars.sh line 36:
FDB_HOME="/fdbhome"
^------^ SC2034 (warning): FDB_HOME appears unused. Verify use (or export if
used externally).
In tools/fdb/fdb_vars.sh line 38:
USER=`whoami`
^------^ SC2006 (style): Use $(...) notation instead of legacy
backticks `...`.
Did you mean:
USER=$(whoami)
For more information:
https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to
...
https://www.shellcheck.net/wiki/SC2071 -- < is for string comparisons. Use
...
https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and
y...
----------
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:
----------
--- tools/fdb/fdb_ctrl.sh.orig
+++ tools/fdb/fdb_ctrl.sh
@@ -115,7 +115,7 @@
local data_dir_count
# Convert comma-separated DATA_DIRS into an array
- IFS=',' read -r -a DATA_DIR_ARRAY <<< "$DATA_DIRS"
+ IFS=',' read -r -a DATA_DIR_ARRAY <<<"$DATA_DIRS"
data_dir_count=${#DATA_DIR_ARRAY[@]}
# Stateless processes (at least 1, up to 1/4 of CPU cores)
@@ -125,13 +125,13 @@
# Storage processes (must be a multiple of the number of data
directories)
STORAGE_PROCESSES=$((cpu_cores / 4))
[[ $STORAGE_PROCESSES -lt $data_dir_count ]] &&
STORAGE_PROCESSES=$data_dir_count
- STORAGE_PROCESSES=$(( (STORAGE_PROCESSES / data_dir_count) *
data_dir_count ))
+ STORAGE_PROCESSES=$(((STORAGE_PROCESSES / data_dir_count) *
data_dir_count))
# Transaction processes (must be a multiple of the number of data
directories)
TRANSACTION_PROCESSES=$((cpu_cores / 8))
[[ $TRANSACTION_PROCESSES -lt $min_processes ]] &&
TRANSACTION_PROCESSES=$min_processes
[[ $TRANSACTION_PROCESSES -lt $data_dir_count ]] &&
TRANSACTION_PROCESSES=$data_dir_count
- TRANSACTION_PROCESSES=$(( (TRANSACTION_PROCESSES / data_dir_count) *
data_dir_count ))
+ TRANSACTION_PROCESSES=$(((TRANSACTION_PROCESSES / data_dir_count) *
data_dir_count))
echo "Stateless Processes: $STATLESS_PROCESSES"
echo "Storage Processes: $STORAGE_PROCESSES"
@@ -149,9 +149,9 @@
CLUSTER_DESC=${FDB_CLUSTER_DESC:-$FDB_CLUSTER_ID}
# Convert comma-separated DATA_DIRS into an array
- IFS=',' read -r -a DATA_DIR_ARRAY <<< "$DATA_DIRS"
+ IFS=',' read -r -a DATA_DIR_ARRAY <<<"$DATA_DIRS"
for DIR in "${DATA_DIR_ARRAY[@]}"; do
- mkdir -p $DIR || handle_error "Failed to create data directory
$DIR"
+ mkdir -p $DIR || handle_error "Failed to create data directory $DIR"
done
echo -e "\tCreate fdb.cluster, coordinator: $(get_coordinators)"
@@ -190,7 +190,7 @@
for ((i = 0; i < STATLESS_PROCESSES; i++)); do
PORT=$((FDB_PORT + i))
echo "[fdbserver.$PORT]
-class = stateless" | tee -a ${FDB_HOME}/conf/fdb.conf > /dev/null
+class = stateless" | tee -a ${FDB_HOME}/conf/fdb.conf >/dev/null
done
FDB_PORT=$((FDB_PORT + STATLESS_PROCESSES))
@@ -202,7 +202,7 @@
DIR_INDEX=$((i % STORAGE_DIR_COUNT))
echo "[fdbserver.$PORT]
class = storage
-datadir = ${DATA_DIR_ARRAY[$DIR_INDEX]}/$PORT" | tee -a
${FDB_HOME}/conf/fdb.conf > /dev/null
+datadir = ${DATA_DIR_ARRAY[$DIR_INDEX]}/$PORT" | tee -a
${FDB_HOME}/conf/fdb.conf >/dev/null
done
FDB_PORT=$((FDB_PORT + STORAGE_PROCESSES))
@@ -213,12 +213,12 @@
DIR_INDEX=$((i % STORAGE_DIR_COUNT))
echo "[fdbserver.$PORT]
class = transaction
-datadir = ${DATA_DIR_ARRAY[$DIR_INDEX]}/$PORT" | tee -a
${FDB_HOME}/conf/fdb.conf > /dev/null
+datadir = ${DATA_DIR_ARRAY[$DIR_INDEX]}/$PORT" | tee -a
${FDB_HOME}/conf/fdb.conf >/dev/null
done
echo "[backup_agent]
command = ${FDB_HOME}/backup_agent
-logdir = ${LOG_DIR}" | tee -a ${FDB_HOME}/conf/fdb.conf > /dev/null
+logdir = ${LOG_DIR}" | tee -a ${FDB_HOME}/conf/fdb.conf >/dev/null
echo "Deploy FDB to: ${FDB_HOME}"
}
@@ -345,37 +345,36 @@
skip_config="false"
case $cmd in
- deploy)
- deploy "$job" $skip_pkg $skip_config
- ;;
- start)
- start "$job" "${init}"
- ;;
- stop)
- stop "$job"
- ;;
- clean)
- clean "$job"
- ;;
- fdbcli)
- ${FDB_HOME}/fdbcli -C ${FDB_HOME}/conf/fdb.cluster $@
- ;;
- mysql)
- is_fe_connectable
- mysql -uroot -h127.0.0.1 -P$(fe_query_port 0)
- ;;
- config)
- generate_regression_config true
- ;;
- run)
- is_fe_connectable
- run_regression $skip_config $@
- ;;
- status)
- status
- ;;
- *)
- unknown_cmd $cmd
- ;;
+deploy)
+ deploy "$job" $skip_pkg $skip_config
+ ;;
+start)
+ start "$job" "${init}"
+ ;;
+stop)
+ stop "$job"
+ ;;
+clean)
+ clean "$job"
+ ;;
+fdbcli)
+ ${FDB_HOME}/fdbcli -C ${FDB_HOME}/conf/fdb.cluster $@
+ ;;
+mysql)
+ is_fe_connectable
+ mysql -uroot -h127.0.0.1 -P$(fe_query_port 0)
+ ;;
+config)
+ generate_regression_config true
+ ;;
+run)
+ is_fe_connectable
+ run_regression $skip_config $@
+ ;;
+status)
+ status
+ ;;
+*)
+ unknown_cmd $cmd
+ ;;
esac
-
--- tools/fdb/fdb_vars.sh.orig
+++ tools/fdb/fdb_vars.sh
@@ -35,4 +35,4 @@
# Define the FoundationDB home directory
FDB_HOME="/fdbhome"
-USER=`whoami`
+USER=$(whoami)
----------
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: [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]