-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
For new checks and feature suggestions
- https://www.shellcheck.net/ (i.e. the latest commit) currently gives no useful warnings about this
- I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related
Here's a snippet or screenshot that shows a potential problem:
seach-java:
#!/bin/sh
trap ./clean ERR EXIT SIGINT
(false)
ls test/*
find "$JAVA_HOME" -type f -name -print0 |
xargs -0 echo
$ mkdir -p test/fixtures
$ unset JAVA_HOME
$ ./search-java
...
Here's what shellcheck currently says:
Nothing
Here's what I wanted to see:
- Prefer function traps to list traps for safety
- Enable
set -e
to safeguard against system corruption - Enable
set -u
to safeguard against potentially undefined variables - Enable
set -f
to safeguard against glob portability issues - Enable
set -o pipefail
to safeguard against failures during piped aggregate commands
Metadata
Metadata
Assignees
Labels
No labels