conda-forge / conda-smithy

The tool for managing conda-forge feedstocks.
https://conda-forge.org/
BSD 3-Clause "New" or "Revised" License
149 stars 176 forks source link

Allow customizations of shellcheck linter #1965

Open mbargull opened 3 months ago

mbargull commented 3 months ago

Comment:

As is, the shellcheck option unconditionally runs

shellcheck --enable=all --shell=bash --exclude=SC2154 "${RECIPE_DIR}"/*.sh

if enabled. There are cases in which one would want to customize these options, e.g., in case of activation scripts it can make sense to use --shell=sh to lint for broader than Bash compatibility.

One flexible solution could be to turn the option from a Boolean switch to something akin to this:

shellcheck:
  - files: 'build.sh'
    args: [--enable=all, --shell=bash, --exclude=SC2154]
  - files: '*activate-*.sh'
    args: [--enable=all, --shell=sh]