Fix remaining FIXME for tty error color output.

This commit is contained in:
Vidar Holen
2015-12-06 12:48:53 -08:00
parent 8acd5b13cd
commit b4390414ef
5 changed files with 37 additions and 31 deletions

View File

@@ -34,30 +34,21 @@ data CheckSpec = CheckSpec {
csFilename :: String,
csScript :: String,
csExcludedWarnings :: [Integer],
csColorOption :: ColorOptions,
csShellTypeOverride :: Maybe Shell
} deriving (Show, Eq)
data CheckResult = CheckResult {
crFilename :: String,
crComments :: [PositionedComment],
crColorOption :: ColorOptions
crComments :: [PositionedComment]
} deriving (Show, Eq)
emptyCheckSpec = CheckSpec {
csFilename = "",
csScript = "",
csExcludedWarnings = [],
csShellTypeOverride = Nothing,
csColorOption = ColorAuto
csShellTypeOverride = Nothing
}
data ColorOptions =
ColorAuto
| ColorAlways
| ColorNever
deriving (Ord, Eq, Show)
-- Parser input and output
data ParseSpec = ParseSpec {
psFilename :: String,
@@ -81,6 +72,13 @@ data AnalysisResult = AnalysisResult {
arComments :: [TokenComment]
}
-- Formatter options
data FormatterOptions = FormatterOptions {
foColorOption :: ColorOption
}
-- Supporting data types
data Shell = Ksh | Sh | Bash | Dash deriving (Show, Eq)
data ExecutionMode = Executed | Sourced deriving (Show, Eq)
@@ -99,6 +97,12 @@ data Comment = Comment Severity Code String deriving (Show, Eq)
data PositionedComment = PositionedComment Position Comment deriving (Show, Eq)
data TokenComment = TokenComment Id Comment deriving (Show, Eq)
data ColorOption =
ColorAuto
| ColorAlways
| ColorNever
deriving (Ord, Eq, Show)
-- For testing
mockedSystemInterface :: [(String, String)] -> SystemInterface Identity
mockedSystemInterface files = SystemInterface {