From 92945f9e855284534e103e4f29e069101033a62c Mon Sep 17 00:00:00 2001 From: stuebinm Date: Wed, 6 Apr 2022 18:05:42 +0200 Subject: linter: collect jitsi rooms of maps --- lib/Types.hs | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'lib/Types.hs') diff --git a/lib/Types.hs b/lib/Types.hs index d737392..acba99d 100644 --- a/lib/Types.hs +++ b/lib/Types.hs @@ -54,8 +54,8 @@ 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 | CW [Text] - deriving (Ord, Eq, Generic, ToJSONKey) +data Lint = Depends Dep | Offers Text | Lint Hint | Badge Badge | CW [Text] | Jitsi Text + deriving (Ord, Eq, Generic) data Dep = Local RelPath | Link Text | MapLink Text | LocalMap RelPath deriving (Generic, Ord, Eq, NFData) @@ -78,35 +78,35 @@ lintLevel _ = Info lintsToHints :: [Lint] -> [Hint] lintsToHints = mapMaybe (\case {Lint hint -> Just hint ; _ -> Nothing}) -instance PrettyPrint Lint where - prettyprint (Lint Hint { hintMsg, hintLevel } ) = - " " <> show hintLevel <> ": " <> hintMsg - prettyprint (Depends dep) = - " Info: found dependency: " <> prettyprint dep - prettyprint (Offers dep) = - " Info: map offers entrypoint " <> prettyprint dep - prettyprint (Badge _) = - " Info: found a badge." - prettyprint (CW cws) = - " CWs: " <> show cws +-- instance PrettyPrint Lint where +-- prettyprint (Lint Hint { hintMsg, hintLevel } ) = +-- " " <> show hintLevel <> ": " <> hintMsg +-- prettyprint (Depends dep) = +-- " Info: found dependency: " <> prettyprint dep +-- prettyprint (Offers dep) = +-- " 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 -instance ToJSON Lint where - toJSON (Lint h) = toJSON h - toJSON (Depends dep) = A.object - [ "msg" .= prettyprint dep - , "level" .= A.String "Dependency Info" ] - toJSON (Offers l) = A.object - [ "msg" .= prettyprint l - , "level" .= A.String "Entrypoint Info" ] - 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 Lint where +-- toJSON (Lint h) = toJSON h +-- toJSON (Depends dep) = A.object +-- [ "msg" .= prettyprint dep +-- , "level" .= A.String "Dependency Info" ] +-- toJSON (Offers l) = A.object +-- [ "msg" .= prettyprint l +-- , "level" .= A.String "Entrypoint Info" ] +-- 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 -- cgit v1.2.3