mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated list of optionals for version 0.8.0
13
Optional.md
13
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
|
||||
|
Reference in New Issue
Block a user