diff options
author | stuebinm | 2022-04-04 00:10:56 +0200 |
---|---|---|
committer | stuebinm | 2022-04-04 00:10:56 +0200 |
commit | 7e9941bf90644120b3627d0f0f66204fed9efb2a (patch) | |
tree | 6189ca6d4f2baab04a6759c9ba934295aa06def9 /lib/Types.hs | |
parent | 1db21885df2bd99d65a5aac43bd7fc35ea0ff767 (diff) |
linter: collect content warnings
Diffstat (limited to '')
-rw-r--r-- | lib/Types.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Types.hs b/lib/Types.hs index f58705a..d737392 100644 --- a/lib/Types.hs +++ b/lib/Types.hs @@ -54,7 +54,7 @@ instance HasArguments Level where -- | a hint comes with an explanation (and a level), or is a dependency -- (in which case it'll be otherwise treated as an info hint) -data Lint = Depends Dep | Offers Text | Lint Hint | Badge Badge +data Lint = Depends Dep | Offers Text | Lint Hint | Badge Badge | CW [Text] deriving (Ord, Eq, Generic, ToJSONKey) data Dep = Local RelPath | Link Text | MapLink Text | LocalMap RelPath @@ -87,6 +87,8 @@ instance PrettyPrint Lint where " Info: map offers entrypoint " <> prettyprint dep prettyprint (Badge _) = " Info: found a badge." + prettyprint (CW cws) = + " CWs: " <> show cws instance PrettyPrint Hint where prettyprint (Hint level msg) = " " <> show level <> ": " <> msg @@ -102,6 +104,9 @@ instance ToJSON Lint where toJSON (Badge _) = A.object [ "msg" .= A.String "found a badge" , "level" .= A.String "Badge Info"] + toJSON (CW cws) = A.object + [ "msg" .= A.String "Content Warning" + , "level" .= A.String "CW Info" ] instance ToJSON Hint where toJSON (Hint l m) = A.object |