Set SC2243/SC2244 level to "verbose"

This commit is contained in:
Vidar Holen 2019-04-13 13:40:18 -07:00
parent 9652ccfdbd
commit c860b74505
3 changed files with 5 additions and 3 deletions

View File

@ -7,7 +7,7 @@
- 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 `[`
- SC2243/SC2244: Suggest using explicit -n for `[ $foo ]`
- SC2243/SC2244: Suggest using explicit -n for `[ $foo ]` (verbose)
### Changed
- If a directive or shebang is not specified, a `.bash/.bats/.dash/.ksh`

View File

@ -3159,11 +3159,11 @@ checkNullaryExpansionTest params t =
TC_Nullary _ _ word ->
case getWordParts word of
[t] | isCommandSubstitution t ->
styleWithFix id 2243 "Prefer explicit -n to check for output (or run command without [/[[ to check for success)." fix
verboseWithFix id 2243 "Prefer explicit -n to check for output (or run command without [/[[ to check for success)." fix
-- If they're constant, you get SC2157 &co
x | all (not . isConstant) x ->
styleWithFix id 2244 "Prefer explicit -n to check non-empty string (or use =/-ne to check boolean/integer)." fix
verboseWithFix id 2244 "Prefer explicit -n to check non-empty string (or use =/-ne to check boolean/integer)." fix
_ -> return ()
where
id = getId word

View File

@ -159,6 +159,8 @@ warnWithFix :: MonadWriter [TokenComment] m => Id -> Code -> String -> Fix -> m
warnWithFix = addCommentWithFix WarningC
styleWithFix :: MonadWriter [TokenComment] m => Id -> Code -> String -> Fix -> m ()
styleWithFix = addCommentWithFix StyleC
verboseWithFix :: MonadWriter [TokenComment] m => Id -> Code -> String -> Fix -> m ()
verboseWithFix = addCommentWithFix VerboseC
addCommentWithFix :: MonadWriter [TokenComment] m => Severity -> Id -> Code -> String -> Fix -> m ()
addCommentWithFix severity id code str fix =