hpc-lcov 1.1.2 → 1.2.0
raw patch · 3 files changed
+19/−7 lines, 3 files
Files
- CHANGELOG.md +4/−0
- exe/Main.hs +13/−5
- hpc-lcov.cabal +2/−2
CHANGELOG.md view
@@ -1,3 +1,7 @@+# v1.2.0++* Add support for GHC 9.10 + 9.12+ # v1.1.2 * Add support for GHC 9.8
exe/Main.hs view
@@ -9,11 +9,13 @@ import Control.Monad (forM) import qualified Data.Aeson as JSON import qualified Data.Aeson.Types as JSON+import Data.Char (isDigit) import Data.HashMap.Lazy (HashMap) import qualified Data.HashMap.Lazy as HashMap import Data.List (find, isPrefixOf) import qualified Data.Map as Map import Data.Maybe (fromMaybe)+import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Yaml as Yaml import qualified Options.Applicative as Opt@@ -89,13 +91,11 @@ moduleToMixList <- forM tixModules $ \tixModule -> do (modulePackageName, Mix fileLoc _ _ _ mixEntries) <-- -- tixModuleName is either just the module name or in the format `PACKAGE-VERSION-HASH/MODULE`+ -- tixModuleName is either just the module name or "PACKAGE_ID/MODULE" case Text.splitOn "/" . Text.pack . tixModuleName $ tixModule of- [packageVersionHash, _] -> do- let dropEnd n xs = take (length xs - n) xs- let pkgName = Text.intercalate "-" . dropEnd 2 . Text.splitOn "-" $ packageVersionHash+ [packageId, _] -> do mix <- readMixPathThrow mixDirectories (Right tixModule)- return (Text.unpack pkgName, mix)+ return (Text.unpack $ packageNameFromId packageId, mix) ["Main"] -> do let pkgName = fromMaybe@@ -134,6 +134,14 @@ report = generateLcovFromTix moduleToMix tixModules writeReport cliOutput report++-- Parse the input, which is in one of the following formats:+-- * PACKAGE-VERSION-HASH+-- * PACKAGE-VERSION-HASH-EXE_NAME (>= GHC 9.10)+packageNameFromId :: Text -> Text+packageNameFromId = Text.intercalate "-" . takeWhile (not . isVersion) . Text.splitOn "-"+ where+ isVersion s = '.' `Text.elem` s || Text.all isDigit s {- HPC file discovery -}
hpc-lcov.cabal view
@@ -1,11 +1,11 @@ cabal-version: >= 1.10 --- This file has been generated from package.yaml by hpack version 0.36.0.+-- This file has been generated from package.yaml by hpack version 0.37.0. -- -- see: https://github.com/sol/hpack name: hpc-lcov-version: 1.1.2+version: 1.2.0 synopsis: Convert HPC output into LCOV format description: Convert HPC output into LCOV format. category: Control