mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-12 08:06:29 -07:00
Add a Diff output format
This commit is contained in:
parent
b8b4a11348
commit
b1aeee564c
8 changed files with 265 additions and 8 deletions
|
@ -188,13 +188,7 @@ code num = "SC" ++ show num
|
|||
|
||||
getColorFunc :: ColorOption -> IO ColorFunc
|
||||
getColorFunc colorOption = do
|
||||
term <- hIsTerminalDevice stdout
|
||||
let windows = "mingw" `isPrefixOf` os
|
||||
let isUsableTty = term && not windows
|
||||
let useColor = case colorOption of
|
||||
ColorAlways -> True
|
||||
ColorNever -> False
|
||||
ColorAuto -> isUsableTty
|
||||
useColor <- shouldOutputColor colorOption
|
||||
return $ if useColor then colorComment else const id
|
||||
where
|
||||
colorComment level comment =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue