From a1222f548e865b86bc29a712560968a9d2a30710 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Mon, 27 Nov 2023 13:42:57 +0100 Subject: make provenance obligatory --- app/Issue.hs | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'app/Issue.hs') 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, -- cgit v1.2.3