From 40dbfcfaf0a06a5c8e92a1d5183d8ae4e4634835 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sat, 3 Dec 2022 11:33:21 +0200 Subject: .shellcheckrc: enable optional checks * Suggest explicitly using -n in `[ $var ]`. https://www.shellcheck.net/wiki/SC2243 & https://www.shellcheck.net/wiki/SC2244 * Suggest 'command -v' instead of 'which'. https://www.shellcheck.net/wiki/SC2230 * Suggest quoting variables without metacharacters. https://www.shellcheck.net/wiki/SC2248 * Require [[ and warn about [ in Bash/Ksh. https://www.shellcheck.net/wiki/SC2292 --- .shellcheckrc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .shellcheckrc diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..75aca74 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,11 @@ +# Suggest explicitly using -n in `[ $var ]` +enable=avoid-nullary-conditions + +# Suggest 'command -v' instead of 'which' +enable=deprecate-which + +# Suggest quoting variables without metacharacters +enable=quote-safe-variables + +# Require [[ and warn about [ in Bash/Ksh +enable=require-double-brackets -- cgit v1.2.3-70-g09d2