@@ -196,7 +196,7 @@ checkGenericPackageDescription
196
196
condLibrary_ condSubLibraries_ condForeignLibs_ condExecutables_
197
197
condTestSuites_ condBenchmarks_)
198
198
= do
199
- -- * Description and names.
199
+ -- § Description and names.
200
200
checkPackageDescription packageDescription_
201
201
-- Targets should be present...
202
202
let condAllLibraries = maybeToList condLibrary_ ++
@@ -219,13 +219,13 @@ checkGenericPackageDescription
219
219
-- Flag names.
220
220
mapM_ checkFlagName genPackageFlags_
221
221
222
- -- * Feature checks.
222
+ -- § Feature checks.
223
223
checkSpecVer CabalSpecV2_0 (not . null $ condSubLibraries_)
224
224
(PackageDistInexcusable CVMultiLib )
225
225
checkSpecVer CabalSpecV1_8 (not . null $ condTestSuites_)
226
226
(PackageDistInexcusable CVTestSuite )
227
227
228
- -- * Conditional targets
228
+ -- § Conditional targets
229
229
case condLibrary_ of
230
230
Just cl -> checkCondTarget
231
231
genPackageFlags_
@@ -295,7 +295,7 @@ checkPackageDescription
295
295
_subLibraries_ _executables_ _foreignLibs_ _testSuites_ _benchmarks_
296
296
dataFiles_ dataDir_ extraSrcFiles_ extraTmpFiles_ extraDocFiles_) = do
297
297
298
- -- * Sanity checks.
298
+ -- § Sanity checks.
299
299
checkPackageId package_
300
300
-- TODO `name` is caught at parse level, remove this test.
301
301
let pn = packageName package_
@@ -309,7 +309,7 @@ checkPackageDescription
309
309
checkP (any (== prettyShow pn) (prettyShow <$> nsubs))
310
310
(PackageBuildImpossible $ IllegalLibraryName pn)
311
311
312
- -- * Fields check.
312
+ -- § Fields check.
313
313
checkNull category_
314
314
(PackageDistSuspicious $ MissingField CEFCategory )
315
315
checkNull maintainer_
@@ -326,7 +326,7 @@ checkPackageDescription
326
326
ShortText. length description_ <= ShortText. length synopsis_)
327
327
(PackageDistSuspicious ShortDesc )
328
328
329
- -- * Paths.
329
+ -- § Paths.
330
330
mapM_ (checkPath False " extra-source-files" PathKindGlob ) extraSrcFiles_
331
331
mapM_ (checkPath False " extra-tmp-files" PathKindFile ) extraTmpFiles_
332
332
mapM_ (checkPath False " extra-doc-files" PathKindGlob ) extraDocFiles_
@@ -340,7 +340,7 @@ checkPackageDescription
340
340
mapM_ (checkGlob " extra-source-files" ) extraSrcFiles_
341
341
mapM_ (checkGlob " extra-doc-files" ) extraDocFiles_
342
342
343
- -- * Datafield checks.
343
+ -- § Datafield checks.
344
344
checkSetupBuildInfo setupBuildInfo_
345
345
mapM_ checkTestedWith testedWith_
346
346
either checkNewLicense
@@ -567,7 +567,7 @@ checkLibrary isSub lib@(Library
567
567
(view L. autogenIncludes lib)) $
568
568
(PackageBuildImpossible AutogenIncludesNotIncluded )
569
569
570
- -- * Build infos.
570
+ -- § Build infos.
571
571
checkBuildInfo BITLib (explicitLibModules lib) libBuildInfo_
572
572
573
573
-- Feature checks.
@@ -591,7 +591,7 @@ checkForeignLib (ForeignLib
591
591
checkExecutable :: Monad m => PackageId -> Executable -> CheckM m ()
592
592
checkExecutable pid exe@ (Executable
593
593
exeName_ modulePath_ _exeScope_ buildInfo_) = do
594
- -- * Exe specific checks
594
+ -- § Exe specific checks
595
595
checkP (null modulePath_)
596
596
(PackageBuildImpossible (NoMainIs exeName_))
597
597
-- This check does not apply to scripts.
@@ -600,7 +600,7 @@ checkExecutable pid exe@(Executable
600
600
not (fileExtensionSupportedLanguage $ modulePath_))
601
601
(PackageBuildImpossible NoHsLhsMain )
602
602
603
- -- * Features check
603
+ -- § Features check
604
604
checkSpecVer CabalSpecV1_18
605
605
(fileExtensionSupportedLanguage modulePath_ &&
606
606
takeExtension modulePath_ `notElem` [" .hs" , " .lhs" ])
@@ -614,14 +614,14 @@ checkExecutable pid exe@(Executable
614
614
(view L. autogenIncludes exe))
615
615
(PackageBuildImpossible AutogenIncludesNotIncludedExe )
616
616
617
- -- * Build info checks.
617
+ -- § Build info checks.
618
618
checkBuildInfo BITOther [] buildInfo_
619
619
620
620
checkTestSuite :: Monad m => TestSuite -> CheckM m ()
621
621
checkTestSuite ts@ (TestSuite
622
622
testName_ testInterface_ testBuildInfo_
623
623
_testCodeGenerators_) = do
624
- -- * TS specific checks.
624
+ -- § TS specific checks.
625
625
-- TODO caught by the parser, can remove safely
626
626
case testInterface_ of
627
627
TestSuiteUnsupported tt@ (TestTypeUnknown _ _) ->
@@ -638,12 +638,12 @@ checkTestSuite ts@(TestSuite
638
638
(view L. autogenIncludes ts))
639
639
(PackageBuildImpossible AutogenIncludesNotIncludedExe )
640
640
641
- -- * Feature checks.
641
+ -- § Feature checks.
642
642
checkSpecVer CabalSpecV1_18
643
643
(mainIsNotHsExt && not mainIsWrongExt)
644
644
(PackageDistInexcusable MainCCabal1_18 )
645
645
646
- -- * Build info checks.
646
+ -- § Build info checks.
647
647
checkBuildInfo BITTestBench [] testBuildInfo_
648
648
where
649
649
mainIsWrongExt =
@@ -660,7 +660,7 @@ checkBenchmark :: Monad m => Benchmark -> CheckM m ()
660
660
checkBenchmark bm@ (Benchmark
661
661
benchmarkName_ benchmarkInterface_
662
662
benchmarkBuildInfo_) = do
663
- -- * Interface & bm specific tests.
663
+ -- § Interface & bm specific tests.
664
664
case benchmarkInterface_ of
665
665
BenchmarkUnsupported tt@ (BenchmarkTypeUnknown _ _) ->
666
666
tellP (PackageBuildWarning $ BenchmarkTypeNotKnown tt)
@@ -678,7 +678,7 @@ checkBenchmark bm@(Benchmark
678
678
(view L. autogenIncludes bm))
679
679
(PackageBuildImpossible AutogenIncludesNotIncludedExe )
680
680
681
- -- * BuildInfo checks.
681
+ -- § BuildInfo checks.
682
682
checkBuildInfo BITTestBench [] benchmarkBuildInfo_
683
683
where
684
684
-- Cannot abstract with similar function in checkTestSuite,
@@ -708,7 +708,7 @@ data BITarget = BITLib | BITTestBench | BITOther
708
708
checkBuildInfo :: Monad m => BITarget -> [ModuleName ] -> BuildInfo ->
709
709
CheckM m ()
710
710
checkBuildInfo t ams bi = do
711
- -- * Options.
711
+ -- § Options.
712
712
checkGHCOptions " ghc-options" t (hcOptions GHC bi)
713
713
checkGHCOptions " ghc-prof-options" t (hcProfOptions GHC bi)
714
714
checkGHCOptions " ghc-shared-options" t (hcSharedOptions GHC bi)
@@ -717,7 +717,7 @@ checkBuildInfo t ams bi = do
717
717
checkCLikeOptions " C++" " cxx-options" (cxxOptions bi) ldOpts
718
718
checkCPPOptions (cppOptions bi)
719
719
720
- -- * Paths: content.
720
+ -- § Paths: content.
721
721
mapM_ checkLang (allLanguages bi)
722
722
mapM_ checkExt (allExtensions bi)
723
723
mapM_ checkDep (targetBuildDepends bi)
@@ -726,7 +726,7 @@ checkBuildInfo t ams bi = do
726
726
let ds = buildToolDepends bi ++ catMaybes (map df $ buildTools bi)
727
727
mapM_ checkBTDep ds
728
728
729
- -- * Paths: well formedness
729
+ -- § Paths: well formedness
730
730
mapM_ (checkPath False " asm-sources" PathKindFile ) (asmSources bi)
731
731
mapM_ (checkPath False " cmm-sources" PathKindFile ) (cmmSources bi)
732
732
mapM_ (checkPath False " c-sources" PathKindFile ) (cSources bi)
@@ -746,7 +746,7 @@ checkBuildInfo t ams bi = do
746
746
(extraLibDirsStatic bi)
747
747
mapM_ checkOptionPath (perCompilerFlavorToList $ options bi)
748
748
749
- -- * Feature checks --
749
+ -- § Feature checks --
750
750
sv <- asksCM ccSpecVersion
751
751
checkSpecVer CabalSpecV1_10 (isJust $ defaultLanguage bi)
752
752
(PackageBuildWarning CVDefaultLanguage )
0 commit comments