diff options
author | Alexander Foremny <aforemny@posteo.de> | 2023-12-18 07:38:22 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2023-12-18 07:38:24 +0100 |
commit | c8ab97e77c8ab56b9835d9f260dc222a10e9b3c6 (patch) | |
tree | edeffd14127196b19e6205ba71b4abe3d0e00a09 /app/History.hs | |
parent | 4fe90ed3e41fb54a65e203719824d0fcf272909f (diff) |
feat: add support for c, elm, nix, shell
Diffstat (limited to 'app/History.hs')
-rw-r--r-- | app/History.hs | 9 |
1 files changed, 6 insertions, 3 deletions
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) |