Issue 837 flag to include only certain warnings

Issue https://github.com/koalaman/shellcheck/issues/837

Add an --include option, which creates a whitelist of warnings to report
on, the opposite of --exclude.
This commit is contained in:
Gandalf- 2019-01-18 20:15:52 -08:00
parent a621eba6d3
commit 59c47f2266
4 changed files with 52 additions and 5 deletions

View file

@ -21,7 +21,7 @@
module ShellCheck.Interface
(
SystemInterface(..)
, CheckSpec(csFilename, csScript, csCheckSourced, csExcludedWarnings, csShellTypeOverride, csMinSeverity)
, CheckSpec(csFilename, csScript, csCheckSourced, csIncludedWarnings, csExcludedWarnings, csShellTypeOverride, csMinSeverity)
, CheckResult(crFilename, crComments)
, ParseSpec(psFilename, psScript, psCheckSourced, psShellTypeOverride)
, ParseResult(prComments, prTokenPositions, prRoot)
@ -80,6 +80,7 @@ data CheckSpec = CheckSpec {
csScript :: String,
csCheckSourced :: Bool,
csExcludedWarnings :: [Integer],
csIncludedWarnings :: Maybe [Integer],
csShellTypeOverride :: Maybe Shell,
csMinSeverity :: Severity
} deriving (Show, Eq)
@ -101,6 +102,7 @@ emptyCheckSpec = CheckSpec {
csScript = "",
csCheckSourced = False,
csExcludedWarnings = [],
csIncludedWarnings = Nothing,
csShellTypeOverride = Nothing,
csMinSeverity = StyleC
}