From c8ab97e77c8ab56b9835d9f260dc222a10e9b3c6 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Mon, 18 Dec 2023 07:38:22 +0100 Subject: feat: add support for c, elm, nix, shell --- app/History.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'app/History.hs') diff --git a/app/History.hs b/app/History.hs index a76e97b..c0427fa 100644 --- a/app/History.hs +++ b/app/History.hs @@ -11,7 +11,7 @@ import CMark qualified as D import Cache (cachedMaybe) import Comment qualified as G import Control.Arrow (first) -import Control.Exception (catch, handle, try) +import Control.Exception (Handler (..), catch, catches, try) import Data.Binary (Binary) import Data.ByteString.Lazy qualified as LB import Data.Digest.Pure.SHA qualified as S @@ -139,9 +139,12 @@ getIssuesAndFilesChanged commitHash = do -- | Get all issues in the given directory and file. getIssuesOfFile :: CommitHash -> FilePath -> IO [I.Issue] getIssuesOfFile commitHash filename = - handle (\(_ :: E.UnknownFileExtension) -> pure []) $ - fmap catMaybes . parMapM (fromComment commitHash) + ( fmap catMaybes . parMapM (fromComment commitHash) =<< G.getComments commitHash filename + ) + `catches` [ Handler \(_ :: E.UnknownFile) -> pure [], + Handler \(_ :: E.UnsupportedLanguage) -> pure [] + ] -- | Note that `provenance` is trivial and needs to be fixed up later. fromComment :: CommitHash -> G.Comment -> IO (Maybe I.Issue) -- cgit v1.2.3