Optionally suggest [[ over [ in Bash scripts (-o require-double-brackets) (fixes #887)

This commit is contained in:
Vidar Holen 2021-07-27 18:53:30 -07:00
parent fbc8d2cb2f
commit fe81dc1c27
3 changed files with 44 additions and 1 deletions

View file

@ -178,7 +178,8 @@ makeCommentWithFix :: Severity -> Id -> Code -> String -> Fix -> TokenComment
makeCommentWithFix severity id code str fix =
let comment = makeComment severity id code str
withFix = comment {
tcFix = Just fix
-- If fix is empty, pretend it wasn't there.
tcFix = if null (fixReplacements fix) then Nothing else Just fix
}
in force withFix