branch: elpa/flycheck
commit 7a8e6df110d23e81a622f6867b4f34b0abcaf6d6
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Add flycheck-shellcheck-enabled-checks option
    
    Add a new option variable to enable optional ShellCheck checks via
    the --enable flag (e.g., setting it to '("all") enables all optional
    checks).
    
    Fixes #1854
---
 flycheck.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/flycheck.el b/flycheck.el
index 286ee47bbd..8820aaca07 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -12685,6 +12685,19 @@ shellcheck directives in the script."
   :safe #'booleanp
   :package-version '(flycheck . "36"))
 
+(flycheck-def-option-var flycheck-shellcheck-enabled-checks nil sh-shellcheck
+  "A list of enabled optional checks for ShellCheck.
+
+The value of this variable is a list of strings, where each
+string is the name of an optional check to enable.  Use \"all\"
+to enable all optional checks.
+
+See the ShellCheck man page for a list of available optional checks."
+  :type '(repeat :tag "Enabled checks"
+                 (string :tag "Check name"))
+  :safe #'flycheck-string-list-p
+  :package-version '(flycheck . "36"))
+
 (flycheck-def-args-var flycheck-shellcheck-args sh-shellcheck
   :package-version '(flycheck . "36"))
 
@@ -12701,6 +12714,8 @@ See URL `https://github.com/koalaman/shellcheck/'."
                          flycheck-shellcheck-follow-sources)
             (option "--exclude" flycheck-shellcheck-excluded-warnings list
                     flycheck-option-comma-separated-list)
+            (option "--enable" flycheck-shellcheck-enabled-checks list
+                    flycheck-option-comma-separated-list)
             (eval flycheck-shellcheck-args)
             "-")
   :standard-input t

Reply via email to