From bc60a750edf734e8b60ededd6e9c3dcb429e542d Mon Sep 17 00:00:00 2001 From: Grische Date: Thu, 11 Nov 2021 14:39:04 +0100 Subject: [PATCH] Updated list of optionals for version 0.8.0 --- Optional.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Optional.md b/Optional.md index ff5bd3d..70f869c 100644 --- a/Optional.md +++ b/Optional.md @@ -26,8 +26,9 @@ However, if you for debugging or evaluation purposes want to see what's availabl ### Available checks -To see which checks are available in your version of ShellCheck, use the `--list-optional` flag. This list is not necessarily up to date: +To see which checks are available in your version of ShellCheck, use the `--list-optional` flag. +Optional checks as of version 0.8.0: ``` $ shellcheck --list-optional @@ -41,6 +42,16 @@ desc: Suggest explicitly using -n in `[ $var ]` example: [ "$var" ] fix: [ -n "$var" ] +name: check-extra-masked-returns +desc: Check for additional cases where exit codes are masked +example: rm -r "$(get_chroot_dir)/home" +fix: set -e; dir="$(get_chroot_dir)"; rm -r "$dir/home" + +name: check-set-e-suppressed +desc: Notify when set -e is suppressed during function invocation +example: set -e; func() { cp *.txt ~/backup; rm *.txt; }; func && echo ok +fix: set -e; func() { cp *.txt ~/backup; rm *.txt; }; func; echo ok + name: check-unassigned-uppercase desc: Warn when uppercase variables are unassigned example: echo $VAR