summaryrefslogtreecommitdiff
path: root/lib/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Types.hs')
-rw-r--r--lib/Types.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Types.hs b/lib/Types.hs
index b609012..fd2bd20 100644
--- a/lib/Types.hs
+++ b/lib/Types.hs
@@ -45,11 +45,11 @@ 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 | Lint Hint
+data Lint = Depends Dep | Offers Text | Lint Hint
-- | TODO: add a reasonable representation of possible urls
data Dep = Local RelPath | Link Text | MapLink Text | LocalMap RelPath
- deriving (Generic)
+ deriving (Generic, Ord, Eq)
data Hint = Hint
{ hintLevel :: Level
@@ -63,20 +63,25 @@ hint level msg = Lint Hint { hintLevel = level, hintMsg = msg }
-- | dependencies just have level Info
lintLevel :: Lint -> Level
-lintLevel (Lint h) = hintLevel h
-lintLevel (Depends _) = Info
+lintLevel (Lint h) = hintLevel h
+lintLevel _ = Info
instance PrettyPrint Lint where
prettyprint (Lint Hint { hintMsg, hintLevel } ) =
" " <> showText hintLevel <> ": " <> hintMsg
prettyprint (Depends dep) =
" Info: found dependency: " <> prettyprint dep
+ prettyprint (Offers dep) =
+ " Info: map offers entrypoint " <> prettyprint dep
instance ToJSON Lint where
toJSON (Lint l) = toJSON l
toJSON (Depends dep) = A.object
[ "hintMsg" .= prettyprint dep
, "hintLevel" .= A.String "Dependency Info" ]
+ toJSON (Offers l) = A.object
+ [ "hintMsg" .= prettyprint l
+ , "hintLevel" .= A.String "Entrypoint Info" ]
instance ToJSON Dep where
toJSON = \case