Set SC2243/SC2244 level to "verbose"
This commit is contained in:
parent
9652ccfdbd
commit
c860b74505
|
@ -7,7 +7,7 @@
|
||||||
- SC2247: Warn about $"(cmd)" and $"{var}"
|
- SC2247: Warn about $"(cmd)" and $"{var}"
|
||||||
- SC2246: Warn if a shebang's interpreter ends with /
|
- SC2246: Warn if a shebang's interpreter ends with /
|
||||||
- SC2245: Warn that Ksh ignores all but the first glob result in `[`
|
- 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
|
### Changed
|
||||||
- If a directive or shebang is not specified, a `.bash/.bats/.dash/.ksh`
|
- If a directive or shebang is not specified, a `.bash/.bats/.dash/.ksh`
|
||||||
|
|
|
@ -3159,11 +3159,11 @@ checkNullaryExpansionTest params t =
|
||||||
TC_Nullary _ _ word ->
|
TC_Nullary _ _ word ->
|
||||||
case getWordParts word of
|
case getWordParts word of
|
||||||
[t] | isCommandSubstitution t ->
|
[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
|
-- If they're constant, you get SC2157 &co
|
||||||
x | all (not . isConstant) x ->
|
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 ()
|
_ -> return ()
|
||||||
where
|
where
|
||||||
id = getId word
|
id = getId word
|
||||||
|
|
|
@ -159,6 +159,8 @@ warnWithFix :: MonadWriter [TokenComment] m => Id -> Code -> String -> Fix -> m
|
||||||
warnWithFix = addCommentWithFix WarningC
|
warnWithFix = addCommentWithFix WarningC
|
||||||
styleWithFix :: MonadWriter [TokenComment] m => Id -> Code -> String -> Fix -> m ()
|
styleWithFix :: MonadWriter [TokenComment] m => Id -> Code -> String -> Fix -> m ()
|
||||||
styleWithFix = addCommentWithFix StyleC
|
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 :: MonadWriter [TokenComment] m => Severity -> Id -> Code -> String -> Fix -> m ()
|
||||||
addCommentWithFix severity id code str fix =
|
addCommentWithFix severity id code str fix =
|
||||||
|
|
Loading…
Reference in New Issue