Skip to content

[CI][Dev] Fix shellcheck errors in the ci/scripts/r_sanitize.sh #50773

Description

@hiroyuki-sato

Describe the enhancement requested

This is the sub issue #44748.

  • SC2155: Declare and assign separately to avoid masking return values.
  • 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_sanitize.sh

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


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

Did you mean:
pushd "${source_dir}"


In ci/scripts/r_sanitize.sh line 36:
echo "MAKEFLAGS=-j${ncores}" >> ${rhome}/etc/Renviron.site
                                ^------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
echo "MAKEFLAGS=-j${ncores}" >> "${rhome}"/etc/Renviron.site


In ci/scripts/r_sanitize.sh line 50:
export SUPPRESSION_FILE=$(readlink -f "tools/ubsan.supp")
       ^--------------^ SC2155 (warning): Declare and assign separately to avoid masking return values.

For more information:
  https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
  https://www.shellcheck.net/wiki/SC2223 -- This default assignment may cause...

Component(s)

Continuous Integration

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions