diff --git a/Ignore.md b/Ignore.md new file mode 100644 index 0000000..37aacd9 --- /dev/null +++ b/Ignore.md @@ -0,0 +1,24 @@ +## Ignoring errors + +To ignore a shellcheck error, you can do one of three things: + +### Ignoring one specific instance in a file + +Use a [[directive]] to disable a certain instance: + + hexToAscii() { + # shellcheck disable=SC2059 + printf "\x$1" + } + +### Ignoring errors in one specific run + +Use a `-e` flag to disable a specific error when running shellcheck: + + $ shellcheck -e SC2059 myscript + +### Ignoring one type of error forever + +Set the `SHELLCHECK_OPTS` variable in your `.bashrc`, `/etc/profile` or equivalent: + + export SHELLCHECK_OPTS="-e SC2059" \ No newline at end of file