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/Main.hs | |
parent | 1731c0484c9bd32cb8f312529e192fb4bdd99dba (diff) |
make provenance obligatory
Diffstat (limited to 'app/Main.hs')
-rw-r--r-- | app/Main.hs | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/app/Main.hs b/app/Main.hs index 4d3902d..1de7360 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -626,20 +626,16 @@ main = do ( \issue -> let title = map (P.annotate P.bold . P.pretty) (T.words issue.title) tags = prettyTags (issue.tags ++ if internalTags then issue.internalTags else []) - openedBy = - fromProvenance $ - P.annotate (P.color P.Black) . ("by" <+>) . P.pretty . (.first.author.name) - openedOn = - fromProvenance $ - P.annotate (P.color P.Black) . ("on" <+>) . P.pretty . show . utctDay . (.first.date) - fromProvenance = flip fmap issue.provenance + openedBy = P.annotate (P.color P.Black) ("by" <+> P.pretty issue.provenance.first.author.name) + openedOn = P.annotate (P.color P.Black) ("on" <+> P.pretty (show (utctDay issue.provenance.first.date))) in P.nest 4 $ P.fillSep ( concat $ [ title, tags, - maybeToList openedOn, - maybeToList openedBy + [ openedOn, + openedBy + ] ] ) ) @@ -655,20 +651,16 @@ main = do ( \issue -> let title = map (P.annotate P.bold . P.pretty) (T.words issue.title) tags = prettyTags (issue.tags ++ if internalTags then issue.internalTags else []) - openedBy = - fromProvenance $ - P.annotate (P.color P.Black) . ("by" <+>) . P.pretty . (.first.author.name) - openedOn = - fromProvenance $ - P.annotate (P.color P.Black) . ("on" <+>) . P.pretty . show . utctDay . (.first.date) - fromProvenance = flip fmap issue.provenance + openedBy = P.annotate (P.color P.Black) ("by" <+> (P.pretty (issue.provenance.first.author.name))) + openedOn = P.annotate (P.color P.Black) ("on" <+> (P.pretty (show (utctDay ((issue.provenance.first.date)))))) in P.nest 4 $ P.fillSep ( concat $ [ title, tags, - maybeToList openedOn, - maybeToList openedBy + [ openedOn, + openedBy + ] ] ) ) @@ -722,19 +714,14 @@ main = do issue.file ++ ":" ++ show issue.start.row - ++ ( case issue.provenance of - Nothing -> - "HEAD" - Just provenance -> - "\nvia " - ++ T.unpack provenance.first.hash - ++ "\nby " - ++ T.unpack provenance.first.author.name - ++ " <" - ++ T.unpack provenance.first.author.email - ++ ">\nat " - ++ show provenance.first.date - ) + ++ "\nvia " + ++ T.unpack issue.provenance.first.hash + ++ "\nby " + ++ T.unpack issue.provenance.first.author.name + ++ " <" + ++ T.unpack issue.provenance.first.author.email + ++ ">\nat " + ++ show issue.provenance.first.date ++ "\n\n" sh_ ( ( case width of |