Skip to content
Snippets Groups Projects
Commit 8bd6cef9 authored by stuebinm's avatar stuebinm
Browse files

limit output for frequent lints

it's now limited to just the first ten contexts, then an ellipsis
parent e0d76fc6
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,6 @@ instance ToJSON DirResult where
, "mapLints" .= dirresultMaps res
, "exitGraph" .= showDot (dirresultGraph res)
]
, "resultText" .= prettyprint (Suggestion, res)
, "severity" .= maximumLintLevel res
, "mapInfo" .= fmap (\tm -> A.object [ "badges" .= mapresultBadges tm ])
(dirresultMaps res)
......
......@@ -68,7 +68,10 @@ newtype CollectedLints = CollectedLints (Map Hint [Text])
instance ToJSON CollectedLints where
toJSON (CollectedLints col) = toJSON
. M.mapKeys hintMsg
$ M.mapWithKey (\h cs -> A.object [ "level" .= hintLevel h, "in" .= cs ]) col
$ M.mapWithKey (\h cs -> A.object [ "level" .= hintLevel h, "in" .= truncated cs ]) col
where truncated cs = if length cs > 10
then take 9 cs <> [ "..." ]
else cs
-- | this module's raison d'être
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment