Updated SC2249 (markdown)

Eisuke Kawashima
2025-07-29 10:42:36 +09:00
parent a40c6b465e
commit f02e49a835

@@ -35,7 +35,7 @@ Consider adding a default case to handle other values. If you don't know what to
The example is adapted from a real world Debian init script, which due to a missing default case reports success on any misspelled command (here with underscore instead of dash): The example is adapted from a real world Debian init script, which due to a missing default case reports success on any misspelled command (here with underscore instead of dash):
``` ```console
$ /etc/init.d/screen-cleanup force_reload && echo success $ /etc/init.d/screen-cleanup force_reload && echo success
success success
``` ```
@@ -46,7 +46,7 @@ This suggestion only triggers in verbose mode (`-S verbose`).
If you don't have a default case because the default should be to take no action, consider adding a comment to other humans: If you don't have a default case because the default should be to take no action, consider adding a comment to other humans:
``` ```sh
case "$(uname)" in case "$(uname)" in
CYGWIN*) cygwin=1;; CYGWIN*) cygwin=1;;
MINGW*) mingw=1;; MINGW*) mingw=1;;
@@ -56,7 +56,7 @@ esac
If you believe that it's impossible for the expression to have any other value, it's considered good practice to add the equivalent of an `assert(0)` to fail fast if this assumption should turn out to be incorrect in the current or future versions: If you believe that it's impossible for the expression to have any other value, it's considered good practice to add the equivalent of an `assert(0)` to fail fast if this assumption should turn out to be incorrect in the current or future versions:
``` ```sh
case "$result" in case "$result" in
true) proceed;; true) proceed;;
false) cancel;; false) cancel;;