Skip to content

[CI][Dev] Fix shellcheck errors in the ci/scripts/r_deps.sh #50609

Description

@hiroyuki-sato

Describe the enhancement requested

This is the sub issue #44748.

  • SC2027: The surrounding quotes actually unquote this. Remove or escape them.
  • SC2086: Double quote to prevent globbing and word splitting.
  • SC2223: This default assignment may cause DoS due to globbing. Quote it.
shellcheck ci/scripts/r_deps.sh

In ci/scripts/r_deps.sh line 21:
: ${R_BIN:=R}
  ^---------^ SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.


In ci/scripts/r_deps.sh line 23:
: ${R_PRUNE_DEPS:=FALSE}
  ^--------------------^ SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.


In ci/scripts/r_deps.sh line 24:
R_PRUNE_DEPS=`echo $R_PRUNE_DEPS | tr '[:upper:]' '[:lower:]'`
             ^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
                   ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
R_PRUNE_DEPS=$(echo "$R_PRUNE_DEPS" | tr '[:upper:]' '[:lower:]')


In ci/scripts/r_deps.sh line 26:
: ${R_DUCKDB_DEV:=FALSE}
  ^--------------------^ SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.


In ci/scripts/r_deps.sh line 27:
R_DUCKDB_DEV=`echo $R_DUCKDB_DEV | tr '[:upper:]' '[:lower:]'`
             ^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
                   ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
R_DUCKDB_DEV=$(echo "$R_DUCKDB_DEV" | tr '[:upper:]' '[:lower:]')


In ci/scripts/r_deps.sh line 31:
pushd ${source_dir}
      ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
pushd "${source_dir}"


In ci/scripts/r_deps.sh line 33:
if [ ${R_PRUNE_DEPS} = "true" ]; then
     ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
if [ "${R_PRUNE_DEPS}" = "true" ]; then


In ci/scripts/r_deps.sh line 46:
${R_BIN} -e "options(warn=2); install.packages('remotes'); remotes::install_cran(c('glue', 'rcmdcheck', 'sys')); remotes::install_deps(INSTALL_opts = '"${INSTALL_ARGS}"')"
                                                                                                                                                        ^-------------^ SC2027 (warning): The surrounding quotes actually unquote this. Remove or escape them.
                                                                                                                                                        ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
${R_BIN} -e "options(warn=2); install.packages('remotes'); remotes::install_cran(c('glue', 'rcmdcheck', 'sys')); remotes::install_deps(INSTALL_opts = '""${INSTALL_ARGS}""')"


In ci/scripts/r_deps.sh line 49:
if [ ${R_DUCKDB_DEV} == "true" ]; then
     ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
if [ "${R_DUCKDB_DEV}" == "true" ]; then


In ci/scripts/r_deps.sh line 55:
${R_BIN} -e "remotes::install_deps(dependencies = TRUE, INSTALL_opts = '"${INSTALL_ARGS}"')"
                                                                         ^-------------^ SC2027 (warning): The surrounding quotes actually unquote this. Remove or escape them.
                                                                         ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
${R_BIN} -e "remotes::install_deps(dependencies = TRUE, INSTALL_opts = '""${INSTALL_ARGS}""')"

For more information:
  https://www.shellcheck.net/wiki/SC2027 -- The surrounding quotes actually u...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
  https://www.shellcheck.net/wiki/SC2223 -- This default assignment may cause...

Component(s)

Developer Tools

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions