Skip to content

Commit 255df31

Browse files
committed
Use prett show to show component name
1 parent 1559b76 commit 255df31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Cabal/Distribution/Simple/ShowBuildInfo.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import Distribution.Simple.Utils (cabalVersion)
6969
import Distribution.Simple.Utils.Json
7070
import Distribution.Types.TargetInfo
7171
import Distribution.Text
72+
import Distribution.Pretty
7273

7374
-- | Construct a JSON document describing the build information for a package
7475
mkBuildInfo :: PackageDescription -- ^ Mostly information from the .cabal file
@@ -89,7 +90,7 @@ mkBuildInfo pkg_descr lbi _flags targetsToBuild = info
8990
]
9091

9192
mkCompilerInfo = JsonObject
92-
[ "flavour" .= JsonString (show $ compilerFlavor $ compiler lbi)
93+
[ "flavour" .= JsonString (prettyShow $ compilerFlavor $ compiler lbi)
9394
, "compiler_id" .= JsonString (showCompilerId $ compiler lbi)
9495
, "path" .= path
9596
]
@@ -99,7 +100,7 @@ mkBuildInfo pkg_descr lbi _flags targetsToBuild = info
99100

100101
mkComponentInfo (name, clbi) = JsonObject
101102
[ "type" .= JsonString compType
102-
, "name" .= JsonString (show name)
103+
, "name" .= JsonString (prettyShow name)
103104
, "compiler_args" .= JsonArray (map JsonString $ getCompilerArgs bi lbi clbi)
104105
, "modules" .= JsonArray (map (JsonString . display) modules)
105106
, "source_files" .= JsonArray (map JsonString source_files)

0 commit comments

Comments
 (0)