diff options
Diffstat (limited to '')
-rw-r--r-- | lib/CheckMap.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CheckMap.hs b/lib/CheckMap.hs index ba92d6a..04f3264 100644 --- a/lib/CheckMap.hs +++ b/lib/CheckMap.hs @@ -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 |