diff options
author | Alexander Foremny <aforemny@posteo.de> | 2023-11-27 13:42:57 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2023-11-27 13:43:00 +0100 |
commit | a1222f548e865b86bc29a712560968a9d2a30710 (patch) | |
tree | b79e27a95b3cc42fa3d696ca84c7d91b67f820d7 /app/Issue.hs | |
parent | 1731c0484c9bd32cb8f312529e192fb4bdd99dba (diff) |
make provenance obligatory
Diffstat (limited to 'app/Issue.hs')
-rw-r--r-- | app/Issue.hs | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/app/Issue.hs b/app/Issue.hs index b8deb6e..6d8746d 100644 --- a/app/Issue.hs +++ b/app/Issue.hs @@ -31,12 +31,7 @@ data Issue = Issue { title :: T.Text, description :: Maybe T.Text, file :: String, - -- TODO Make provenance obligatory - -- - -- I cannot think of instances where an issue exists without a provenance.. - -- - -- @difficulty easy - provenance :: Maybe Provenance, + provenance :: Provenance, start :: G.Position, end :: G.Position, tags :: [Tag], @@ -54,18 +49,12 @@ internalTags :: Issue -> [Tag] internalTags (Issue {..}) = concat [ [ Tag "id" $ Just $ toSpinalCase title, - Tag "title" $ Just $ title + Tag "title" $ Just $ title, + Tag "createdAt" $ Just $ T.pack $ show $ utctDay provenance.first.date, + Tag "modifiedAt" $ Just $ T.pack $ show $ utctDay provenance.last.date, + Tag "author" $ Just $ provenance.first.author.name, + Tag "editor" $ Just $ provenance.last.author.name ], - maybe - [] - ( \provenance' -> - [ Tag "createdAt" $ Just $ T.pack $ show $ utctDay provenance'.first.date, - Tag "modifiedAt" $ Just $ T.pack $ show $ utctDay provenance'.last.date, - Tag "author" $ Just $ provenance'.first.author.name, - Tag "editor" $ Just $ provenance'.last.author.name - ] - ) - provenance, map (Tag "type" . Just) markers ] @@ -95,7 +84,7 @@ fromComment cwd comment = do { title = title, description = description, file = comment.file, - provenance = Just provenance, + provenance = provenance, start = comment.start, end = comment.end, tags = maybe [] I.extractTags description, |