Closed sandr01d closed 2 months ago
Do we need to tweak our github action that runs shellcheck to enforce this now? Better than backsliding later on
Do we need to tweak our github action that runs shellcheck to enforce this now? Better than backsliding later on
I think we'd better to keep some flexibility since many checks themselves have exceptions, like SC1091, SC2145, SC2206, etc. IMO we don't have to stick to all checks as long as we have a good reason.
Check list
Description
We sometimes capture multiline output in an array. We used to do so directly, while setting IFS to "\n" to control splitting. This has the downside that bashs glob expansion will be invoked. I think the original reason we did use this technique was that it does work in both zsh and bash. Since we always execute bin/git-forgit in bash now, this is not necessary anymore. We can use
read -r
in such cases to add each line to the array without glob expansion. This is the idiomatic way to do so and recommended in shellcheck 2207. In my personal opinion this is also a cleaner and more straightforward approach than setting and resetting$IFS
.Type of change
Test environment