From 2c107e71572888327496d327a36737c02f64d894 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 14 Mar 2024 06:54:00 +0100 Subject: chore: refactor `Comment.Language.fromPath` --- app/Comment.hs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'app/Comment.hs') diff --git a/app/Comment.hs b/app/Comment.hs index 123acec..febd47e 100644 --- a/app/Comment.hs +++ b/app/Comment.hs @@ -50,15 +50,8 @@ data Point = Point getComments :: Git.CommitHash -> FilePath -> IO [Comment] getComments commitHash filePath = fmap mergeLineComments - . ( extractComments - filePath - ( -- TODO Support amiguous file languages - -- - -- @backlog - N.head language - ) - . LB.toStrict - ) + . extractComments filePath language + . LB.toStrict =<< catch (Git.readTextFileOfBS commitHash filePath) (\(_ :: E.CannotReadFile) -> pure "") -- cgit v1.2.3