Minor renaming and output fixes

This commit is contained in:
Vidar Holen 2018-10-22 18:41:36 -07:00
parent 5ed89d2241
commit a8376a09a9
4 changed files with 57 additions and 28 deletions

View file

@ -52,7 +52,7 @@ instance ToJSON Replacement where
"replaceWith" .= str
]
instance ToJSON (PositionedComment) where
instance ToJSON PositionedComment where
toJSON comment =
let start = pcStartPos comment
end = pcEndPos comment
@ -82,9 +82,14 @@ instance ToJSON (PositionedComment) where
<> "level" .= severityText comment
<> "code" .= cCode c
<> "message" .= cMessage c
<> "replaceWith" .= pcFix comment
<> "fix" .= pcFix comment
)
instance ToJSON Fix where
toJSON fix = object [
"replacements" .= fixReplacements fix
]
outputError file msg = hPutStrLn stderr $ file ++ ": " ++ msg
collectResult ref result _ =
modifyIORef ref (\x -> crComments result ++ x)