@@ -25,7 +25,7 @@ import Distribution.PackageDescription.Configuration
25
25
import Distribution.Verbosity
26
26
( Verbosity )
27
27
import Distribution.Simple.Utils
28
- ( defaultPackageDesc , toUTF8 )
28
+ ( defaultPackageDesc , toUTF8 , wrapText )
29
29
30
30
check :: Verbosity -> IO Bool
31
31
check verbosity = do
@@ -54,23 +54,19 @@ check verbosity = do
54
54
55
55
unless (null buildImpossible) $ do
56
56
putStrLn " The package will not build sanely due to these errors:"
57
- mapM_ (putStrLn . toUTF8. explanation) buildImpossible
58
- putStrLn " "
57
+ printCheckMessages buildImpossible
59
58
60
59
unless (null buildWarning) $ do
61
60
putStrLn " The following warnings are likely affect your build negatively:"
62
- mapM_ (putStrLn . toUTF8 . explanation) buildWarning
63
- putStrLn " "
61
+ printCheckMessages buildWarning
64
62
65
63
unless (null distSuspicious) $ do
66
64
putStrLn " These warnings may cause trouble when distributing the package:"
67
- mapM_ (putStrLn . toUTF8 . explanation) distSuspicious
68
- putStrLn " "
65
+ printCheckMessages distSuspicious
69
66
70
67
unless (null distInexusable) $ do
71
68
putStrLn " The following errors will cause portability problems on other environments:"
72
- mapM_ (putStrLn . toUTF8 . explanation) distInexusable
73
- putStrLn " "
69
+ printCheckMessages distInexusable
74
70
75
71
let isDistError (PackageDistSuspicious {}) = False
76
72
isDistError _ = True
@@ -83,3 +79,7 @@ check verbosity = do
83
79
putStrLn " No errors or warnings could be found in the package."
84
80
85
81
return (null packageChecks)
82
+
83
+ where
84
+ printCheckMessages = mapM_ (putStrLn . format . explanation)
85
+ format = toUTF8 . wrapText . (" * " ++ )
0 commit comments