diff --git a/CHANGELOG.md b/CHANGELOG.md index 434ce79..00faafc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Preliminary support for fix suggestions - Files containing Bats tests can now be checked - Directory wide directives can now be placed in a `.shellcheckrc` +- Verbose mode: Use `-S verbose` for especially pedantic suggestions - SC2247: Warn about $"(cmd)" and $"{var}" - SC2246: Warn if a shebang's interpreter ends with / - SC2245: Warn that Ksh ignores all but the first glob result in `[` diff --git a/shellcheck.1.md b/shellcheck.1.md index 1499c80..b533396 100644 --- a/shellcheck.1.md +++ b/shellcheck.1.md @@ -69,8 +69,9 @@ not warn at all, as `ksh` supports decimals in arithmetic contexts. **-S**\ *SEVERITY*,\ **--severity=***severity* -: Specify minimum severity of errors to consider. Valid values are *error*, - *warning*, *info* and *style*. The default is *style*. +: Specify minimum severity of errors to consider. Valid values in order of + severity are *error*, *warning*, *info*, *style* and *verbose*. + The default is *style*. **-s**\ *shell*,\ **--shell=***shell* diff --git a/shellcheck.hs b/shellcheck.hs index 483da1b..06516e5 100644 --- a/shellcheck.hs +++ b/shellcheck.hs @@ -103,7 +103,7 @@ options = [ "Specify dialect (sh, bash, dash, ksh)", Option "S" ["severity"] (ReqArg (Flag "severity") "SEVERITY") - "Minimum severity of errors to consider (error, warning, info, style)", + "Minimum severity of errors to consider (error, warning, info, style, verbose)", Option "V" ["version"] (NoArg $ Flag "version" "true") "Print version information", Option "W" ["wiki-link-count"] @@ -254,7 +254,8 @@ parseSeverityOption value = ("error", ErrorC), ("warning", WarningC), ("info", InfoC), - ("style", StyleC) + ("style", StyleC), + ("verbose", VerboseC) ] parseOption flag options = diff --git a/src/ShellCheck/Formatter/Format.hs b/src/ShellCheck/Formatter/Format.hs index 57b9d71..bb513cd 100644 --- a/src/ShellCheck/Formatter/Format.hs +++ b/src/ShellCheck/Formatter/Format.hs @@ -47,6 +47,7 @@ severityText pc = WarningC -> "warning" InfoC -> "info" StyleC -> "style" + VerboseC -> "verbose" -- Realign comments from a tabstop of 8 to 1 makeNonVirtual comments contents = diff --git a/src/ShellCheck/Formatter/TTY.hs b/src/ShellCheck/Formatter/TTY.hs index 4e9c272..c0d5841 100644 --- a/src/ShellCheck/Formatter/TTY.hs +++ b/src/ShellCheck/Formatter/TTY.hs @@ -57,6 +57,7 @@ colorForLevel level = "warning" -> 33 -- yellow "info" -> 32 -- green "style" -> 32 -- green + "verbose" -> 32 -- green "message" -> 1 -- bold "source" -> 0 -- none _ -> 0 -- none diff --git a/src/ShellCheck/Interface.hs b/src/ShellCheck/Interface.hs index 3a6d685..0661386 100644 --- a/src/ShellCheck/Interface.hs +++ b/src/ShellCheck/Interface.hs @@ -32,7 +32,7 @@ module ShellCheck.Interface , ExecutionMode(Executed, Sourced) , ErrorMessage , Code - , Severity(ErrorC, WarningC, InfoC, StyleC) + , Severity(ErrorC, WarningC, InfoC, StyleC, VerboseC) , Position(posFile, posLine, posColumn) , Comment(cSeverity, cCode, cMessage) , PositionedComment(pcStartPos , pcEndPos , pcComment, pcFix) @@ -189,7 +189,7 @@ data ExecutionMode = Executed | Sourced deriving (Show, Eq) type ErrorMessage = String type Code = Integer -data Severity = ErrorC | WarningC | InfoC | StyleC +data Severity = ErrorC | WarningC | InfoC | StyleC | VerboseC deriving (Show, Eq, Ord, Generic, NFData) data Position = Position { posFile :: String, -- Filename