summaryrefslogtreecommitdiff
path: root/lib/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Types.hs')
-rw-r--r--lib/Types.hs7
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