From a6a5db7ef7e68122d8d6cf3c8af9aa33989c18d7 Mon Sep 17 00:00:00 2001 From: koalaman Date: Sat, 5 Sep 2015 15:41:27 -0700 Subject: [PATCH] Created Ignore (markdown) --- Ignore.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Ignore.md 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