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)

Clone this wiki locally