Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
Cabal
Commits
1b91f5ec
Commit
1b91f5ec
authored
17 years ago
by
Duncan Coutts
Browse files
Options
Downloads
Patches
Plain Diff
Check for unknown build-type, extensions, licenses and compilers
parent
b5b29f12
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Distribution/PackageDescription.hs
+1
-0
1 addition, 0 deletions
Distribution/PackageDescription.hs
Distribution/PackageDescription/Check.hs
+32
-2
32 additions, 2 deletions
Distribution/PackageDescription/Check.hs
with
33 additions
and
2 deletions
Distribution/PackageDescription.hs
+
1
−
0
View file @
1b91f5ec
...
...
@@ -44,6 +44,7 @@ module Distribution.PackageDescription (
PackageDescription
(
..
),
emptyPackageDescription
,
BuildType
(
..
),
knownBuildTypes
,
-- ** Libraries
Library
(
..
),
...
...
This diff is collapsed.
Click to expand it.
Distribution/PackageDescription/Check.hs
+
32
−
2
View file @
1b91f5ec
...
...
@@ -109,6 +109,8 @@ check True pc = Just pc
-- TODO: Once we implement striping (ticket #88) we should also reject
-- ghc-options: -optl-Wl,-s.
-- * check for unknown 'OS's and 'Arch's. This requires checking the
-- 'GenericPackageDescription' which we do not currently get passed.
-- | Check for common mistakes and problems in package descriptions.
--
...
...
@@ -211,8 +213,26 @@ checkFields pkg =
catMaybes
[
check
(
isNothing
(
buildType
pkg
))
$
PackageBuildWarning
"No 'build-type' specified. If possible use 'build-type: Simple'."
PackageBuildWarning
$
"No 'build-type' specified. If you do not need a custom Setup.hs or "
++
"./configure script then use 'build-type: Simple'."
,
case
buildType
pkg
of
Just
(
UnknownBuildType
unknown
)
->
Just
$
PackageBuildWarning
$
quote
unknown
++
" is not a known 'build-type'. "
++
"The known build types are: "
++
intercalate
", "
(
map
display
knownBuildTypes
)
_
->
Nothing
,
check
(
not
(
null
unknownCompilers
))
$
PackageBuildWarning
$
"Unknown compiler "
++
intercalate
", "
(
map
quote
unknownCompilers
)
++
" in 'tested-with' field."
,
check
(
not
(
null
unknownExtensions
))
$
PackageBuildWarning
$
"Unknown extensions: "
++
intercalate
", "
unknownExtensions
,
check
(
null
(
category
pkg
))
$
PackageDistSuspicious
"No 'category' field."
...
...
@@ -230,6 +250,10 @@ checkFields pkg =
PackageDistSuspicious
"The 'synopsis' field is rather long (max 80 chars is recommended)."
]
where
unknownCompilers
=
[
name
|
(
OtherCompiler
name
,
_
)
<-
testedWith
pkg
]
unknownExtensions
=
[
name
|
bi
<-
allBuildInfo
pkg
,
UnknownExtension
name
<-
extensions
bi
]
checkLicense
::
PackageDescription
->
[
PackageCheck
]
checkLicense
pkg
=
...
...
@@ -239,6 +263,12 @@ checkLicense pkg =
PackageDistInexcusable
"The 'license' field is missing or specified as AllRightsReserved."
,
case
license
pkg
of
UnknownLicense
l
->
Just
$
PackageBuildWarning
$
quote
(
"license: "
++
l
)
++
" is not a recognised license."
_
->
Nothing
,
check
(
license
pkg
==
BSD4
)
$
PackageDistSuspicious
$
"Using 'license: BSD4' is almost always a misunderstanding. 'BSD4' "
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment