@@ -99,34 +99,35 @@ check verbosity = do
99
99
100
100
-- Poor man’s “group checks by constructor”.
101
101
groupChecks :: [PackageCheck ] -> [NE. NonEmpty PackageCheck ]
102
- groupChecks ds = NE. groupBy (F. on (==) constInt)
103
- (L. sortBy (F. on compare constInt) ds)
104
- where
105
- constInt :: PackageCheck -> Int
106
- constInt (PackageBuildImpossible {}) = 0
107
- constInt (PackageBuildWarning {}) = 1
108
- constInt (PackageDistSuspicious {}) = 2
109
- constInt (PackageDistSuspiciousWarn {}) = 3
110
- constInt (PackageDistInexcusable {}) = 4
102
+ groupChecks ds =
103
+ NE. groupBy
104
+ (F. on (==) constInt)
105
+ (L. sortBy (F. on compare constInt) ds)
106
+ where
107
+ constInt :: PackageCheck -> Int
108
+ constInt (PackageBuildImpossible {}) = 0
109
+ constInt (PackageBuildWarning {}) = 1
110
+ constInt (PackageDistSuspicious {}) = 2
111
+ constInt (PackageDistSuspiciousWarn {}) = 3
112
+ constInt (PackageDistInexcusable {}) = 4
111
113
112
114
groupExplanation :: PackageCheck -> String
113
- groupExplanation (PackageBuildImpossible {}) = " The package will not build sanely due to these errors:"
114
- groupExplanation (PackageBuildWarning {}) = " The following errors are likely to affect your build negatively:"
115
- groupExplanation (PackageDistSuspicious {}) = " These warnings will likely cause trouble when distributing the package:"
116
- groupExplanation (PackageDistSuspiciousWarn {}) = " These warnings may cause trouble when distributing the package:"
117
- groupExplanation (PackageDistInexcusable {}) = " The following errors will cause portability problems on other environments:"
115
+ groupExplanation (PackageBuildImpossible {}) = " The package will not build sanely due to these errors:"
116
+ groupExplanation (PackageBuildWarning {}) = " The following errors are likely to affect your build negatively:"
117
+ groupExplanation (PackageDistSuspicious {}) = " These warnings will likely cause trouble when distributing the package:"
118
+ groupExplanation (PackageDistSuspiciousWarn {}) = " These warnings may cause trouble when distributing the package:"
119
+ groupExplanation (PackageDistInexcusable {}) = " The following errors will cause portability problems on other environments:"
118
120
119
121
groupOutputFunction :: PackageCheck -> Verbosity -> String -> IO ()
120
- groupOutputFunction (PackageBuildImpossible {}) ver = warnError ver
121
- groupOutputFunction (PackageBuildWarning {}) ver = warnError ver
122
- groupOutputFunction (PackageDistSuspicious {}) ver = warn ver
123
- groupOutputFunction (PackageDistSuspiciousWarn {}) ver = warn ver
124
- groupOutputFunction (PackageDistInexcusable {}) ver = warnError ver
122
+ groupOutputFunction (PackageBuildImpossible {}) ver = warnError ver
123
+ groupOutputFunction (PackageBuildWarning {}) ver = warnError ver
124
+ groupOutputFunction (PackageDistSuspicious {}) ver = warn ver
125
+ groupOutputFunction (PackageDistSuspiciousWarn {}) ver = warn ver
126
+ groupOutputFunction (PackageDistInexcusable {}) ver = warnError ver
125
127
126
128
outputGroupCheck :: Verbosity -> NE. NonEmpty PackageCheck -> IO ()
127
129
outputGroupCheck ver pcs = do
128
- let hp = NE. head pcs
129
- outf = groupOutputFunction hp ver
130
- notice ver (groupExplanation hp)
131
- CM. mapM_ (outf . ppPackageCheck) pcs
132
-
130
+ let hp = NE. head pcs
131
+ outf = groupOutputFunction hp ver
132
+ notice ver (groupExplanation hp)
133
+ CM. mapM_ (outf . ppPackageCheck) pcs
0 commit comments