Commit 7d39aa01 authored by quasicomputational's avatar quasicomputational Committed by Alexis Williams

Knock the pre-distribution checks down to just warnings

parent bb87599d
......@@ -2157,6 +2157,9 @@ checkTarPath path
-- and package-creation environment. Hence we can use IO, rather than needing
-- to pass a 'CheckPackageContentOps' dictionary around.
checkPackageFilesPreDistribution :: Verbosity -> PackageDescription -> FilePath -> NoCallStackIO [PackageCheck]
-- Note: this really shouldn't return any 'Inexcusable' warnings,
-- because that will make us say that Hackage would reject the package.
-- But, because Hackage doesn't run these tests, that will be a lie!
checkPackageFilesPreDistribution = checkGlobFiles
-- | Discover problems with the package's wildcards.
......@@ -2169,7 +2172,7 @@ checkGlobFiles verbosity pkg root =
results <- matchDirFileGlob' verbosity (specVersion pkg) (root </> dir) glob
let individualWarnings = results >>= getWarning field glob
noMatchesWarning =
[ PackageDistInexcusable $
[ PackageDistSuspiciousWarn $
"In '" ++ field ++ "': the pattern '" ++ glob ++ "' does not"
++ " match any files."
| all (not . suppressesNoMatchesWarning) results
......@@ -2206,7 +2209,7 @@ checkGlobFiles verbosity pkg root =
++ " To enable looser suffix-only matching, set 'cabal-version: 2.4' or higher."
]
getWarning field glob (GlobMissingDirectory dir) =
[ PackageDistInexcusable $
[ PackageDistSuspiciousWarn $
"In '" ++ field ++ "': the pattern '" ++ glob ++ "' attempts to"
++ " match files in the directory '" ++ dir ++ "', but there is no"
++ " directory by that name."
......
# cabal check
Warning: The package will not build sanely due to these errors:
Warning: This package description follows version 2.4 of the Cabal specification. This tool only supports up to version 2.3.0.0.
Warning: The following errors will cause portability problems on other environments:
Warning: These warnings may cause trouble when distributing the package:
Warning: In 'data-files': the pattern 'another-non-existent-directory/**/*.dat' attempts to match files in the directory 'another-non-existent-directory', but there is no directory by that name.
Warning: In 'extra-doc-files': the pattern 'non-existent-directory/*.html' attempts to match files in the directory 'non-existent-directory', but there is no directory by that name.
Warning: In 'extra-doc-files': the pattern 'present/present/missing/*.tex' attempts to match files in the directory 'present/present/missing', but there is no directory by that name.
......
# cabal check
Warning: The following errors will cause portability problems on other environments:
Warning: These warnings may cause trouble when distributing the package:
Warning: In 'data-files': the pattern 'non-existent-directory/*.dat' attempts to match files in the directory 'non-existent-directory', but there is no directory by that name.
Warning: Hackage would reject this package.
import Test.Cabal.Prelude
main = cabalTest $
fails $ cabal "check" []
main = cabalTest $ cabal "check" []
# cabal check
Warning: The following errors will cause portability problems on other environments:
Warning: These warnings may cause trouble when distributing the package:
Warning: In 'extra-doc-files': the pattern '*.html' does not match any files.
Warning: Hackage would reject this package.
import Test.Cabal.Prelude
main = cabalTest $
fails $ cabal "check" []
main = cabalTest $ cabal "check" []
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment