File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,9 @@ fix mode verbose tabSize f =
223223 hPutStrLn stderr $
224224 " [ Violation " ++
225225 (if mode == Fix then " fixed" else " detected" ) ++
226- " ] " ++ f ++ " :\n " ++ (unlines $ map displayViolations vs)
226+ " ] " ++ f ++
227+ (if mode == Fix then " " else
228+ " :\n " ++ (unlines $ map (displayViolations f) vs))
227229
228230 when (mode == Fix ) $
229231 withFile f WriteMode $ \ h -> do
@@ -240,8 +242,8 @@ fix mode verbose tabSize f =
240242-- Stores the index of the line and the line itself.
241243data LineViolating = LV Int Text
242244
243- displayViolations :: LineViolating -> String
244- displayViolations (LV i l) = " line " ++ show i ++ " ] " ++
245+ displayViolations :: FilePath -> LineViolating -> String
246+ displayViolations fname (LV i l) = fname ++ " : " ++ show i ++ " : " ++
245247 (Text. unpack $ visibleSpaces l)
246248
247249-- | The transformation monad: maintains info about lines that
@@ -331,5 +333,5 @@ dropWhile1 p (x:xs)
331333-- presentation purposes. Space turns into '·' and tab into '→'
332334visibleSpaces :: Text -> Text
333335visibleSpaces s
334- | Text. null s = " <empty line >"
335- | otherwise = Text. replace " \t " " → " . Text. replace " " " ·" $ s
336+ | Text. null s = " <NEWLINE >"
337+ | otherwise = Text. replace " \t " " <TAB> " . Text. replace " " " ·" $ s
You can’t perform that action at this time.
0 commit comments