Skip to content

Address the Linter comments

Guoqing Ge edited this page Apr 25, 2025 · 2 revisions

1. Run Linter Check offline

One can run ShellCheck offline as follows:

workflow/ush/linter_shellcheck.sh   scripts/exrrfs_ic.sh

This way, one doesn't need to wait for the online linting results.

Similarly, one can run the Python and YAML linters as follows:

workflow/ush/linter_pythoncheck.sh   ush/yaml_finalize
workflow/ush/linter_yamlcheck.sh   parm/jedivar.yaml

For Python codes, the following command can address most Python linting comments by modifying the Python codes directly:

workflow/ush/linter_pythonmodify.sh   ush/yaml_finalize

2. Examples for addressing Shellcheck comments:

for yaml in ${yaml_list[@]}; do
==>
for yaml in "${yaml_list[@]}"; do


ls ./ioda*nc
if (( $? == 0 )); then
=>
if ls ./ioda*nc; then


cd ${DATA}
=>
cd "${DATA}" || exit 1


ln -snf ${FIXrrfs}/physics/${PHYSICS_SUITE}/* .
=>
ln -snf "${FIXrrfs}/physics/${PHYSICS_SUITE}"/*  .


fhr_all=(${fhr_string})
=>
read -ra fhr_all <<< "${fhr_string}"


if (( $i >= ${num_fhrs} )); then
=>
if (( i >= num_fhrs )); then


nEXEC=$(ls -1 ../exec | wc -l)
=>
nEXEC=$(find ../exec/* | wc -l)
    while [[ $s -le 59 ]]; do
      ss=$(printf %2.2i ${s})
      nsslfile="${NSSL}/*${mrms}_00.50_${YYYY}${MM}${DD}-${HH}${min}${ss}.${obs_appendix}"
      if [ -s ${nsslfile} ]; then
        echo "Found ${nsslfile}"
        nsslfile1="*${mrms}_*_${YYYY}${MM}${DD}-${HH}${min}*.${obs_appendix}"
	numgrib2=$(find ${NSSL}/${nsslfile1} -maxdepth 1 -type f | wc -l)
        echo "Number of GRIB-2 files: ${numgrib2}"
        if [ "${numgrib2}" -ge 10 ] && [ ! -e filelist_mrms ]; then
          cp ${NSSL}/${nsslfile1} .
          ls ${nsslfile1} > filelist_mrms
          echo "Creating links for ${YYYY}${MM}${DD}-${HH}${min}"
	  break
        fi
      fi

to

Clone this wiki locally