From 10993b2c89a6ddc30eba71b9142699cdc390c0eb Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Fri, 2 Sep 2022 09:54:23 +0200 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9CIgnore=20warning=E2=80=9D=20opti?= =?UTF-8?q?on=20to=20cabal=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Command line option: -i/--ignore. e.g. cabal check --ignore=missing-upper-bounds will not display “Missing upper bounds” warnings. * Additionally, a filterPackageChecksById function is now exported in Distribution.PackageDescription.Check.Warning; this can be used by third party tools. * Add CheckExplanationIDString to `cabal check` messages. e.g. from Error: The 'license' field is missing or is NONE. to Error: [license-none] The 'license' field is missing or is NONE. This makes using the cabal check `--ignore` option more immediate. * Spool `MissingField` into separate constructors. Introducing five new constructors for `CheckExplanation` MissingFieldCategory MissingFieldMaintainer MissingFieldSynopsis MissingFieldDescription MissingFieldSynOrDesc This provides better ergonomic for `cabal check --ignore` and makes it easier to update the manual if the need arises. * Add tests for desiderable `--ignore` string qualities (not too long, without too many '-', unique). * Warn when `--ignore` string is not recognised. Also add a test for this. * Add documentation. * Add changelog. --- Cabal-tests/Cabal-tests.cabal | 1 + .../regressions/all-upper-bound.check | 2 +- .../regressions/assoc-cpp-options.check | 2 +- .../regressions/bad-glob-syntax.check | 4 +- .../cc-options-with-optimization.check | 2 +- .../cxx-options-with-optimization.check | 2 +- .../regressions/decreasing-indentation.check | 2 +- .../regressions/denormalised-paths.check | 28 +- .../regressions/extensions-paths-5054.check | 2 +- .../regressions/ghc-option-j.check | 4 +- .../regressions/issue-6288-d.check | 2 +- .../ParserTests/regressions/issue-774.check | 10 +- .../regressions/issue-7776-a.check | 2 +- .../regressions/issue-7776-b.check | 2 +- .../regressions/issue-7776-c.check | 2 +- .../regressions/multiple-libs-2.check | 10 +- .../regressions/nothing-unicode.check | 12 +- .../regressions/pre-1.6-glob.check | 2 +- .../regressions/pre-2.4-globstar.check | 6 +- .../pre-3.8-globstar-literal.check | 2 +- .../regressions/public-multilib-1.check | 4 +- .../regressions/public-multilib-2.check | 4 +- Cabal-tests/tests/UnitTests.hs | 3 + .../Distribution/PackageDescription/Check.hs | 34 ++ .../Distribution/PackageDescription/Check.hs | 16 +- .../PackageDescription/Check/Monad.hs | 1 - .../PackageDescription/Check/Warning.hs | 504 +++++++++++++++++- .../src/Distribution/Client/Check.hs | 9 +- cabal-install/src/Distribution/Client/Main.hs | 10 +- .../src/Distribution/Client/Setup.hs | 70 ++- .../AutogenModules/Package/setup.cabal.out | 22 +- .../AutogenModules/Package/setup.out | 22 +- .../Backpack/Reexport2/setup.cabal.out | 2 +- .../PackageTests/Backpack/Reexport2/setup.out | 2 +- .../setup.cabal.out | 2 +- .../BuildToolDependsInternalMissing/setup.out | 2 +- .../CCompilerOverride/setup.cabal.out | 2 +- .../PackageTests/CCompilerOverride/setup.out | 2 +- .../COptions/CCOptionsExtraLibDirs/cabal.out | 2 +- .../COptions/CCOptionsInclude/cabal.out | 2 +- .../COptions/CppNotPortable/cabal.out | 2 +- .../CxxOptionsExtraLibraries/cabal.out | 2 +- .../COptions/CxxOs/cabal.out | 2 +- .../CabalVersion/AutoGenMods/cabal.out | 4 +- .../CabalVersion/CustomSetup/cabal.out | 2 +- .../CabalVersion/DefaultExtension/cabal.out | 2 +- .../CabalVersion/DefaultLanguage/cabal.out | 2 +- .../DefaultLanguageSpec/cabal.out | 2 +- .../CabalVersion/ExtensionBreak/cabal.out | 2 +- .../CabalVersion/Extensions/cabal.out | 4 +- .../CabalVersion/ExtraDoc/cabal.out | 2 +- .../ExtraDynamicLibraryFlavour/cabal.out | 2 +- .../CabalVersion/ExtraFrameworkDirs/cabal.out | 2 +- .../CabalVersion/Mixins/cabal.out | 2 +- .../CabalVersion/MultiLibs/cabal.out | 2 +- .../CabalVersion/Reexported/cabal.out | 2 +- .../CabalVersion/SourceRepository/cabal.out | 2 +- .../CabalVersion/Sources/cabal.out | 2 +- .../CabalVersion/Testsuite1.8/cabal.out | 2 +- .../CabalVersion/VirtualModules/cabal.out | 2 +- .../Fields/DeprecatedExtension/cabal.out | 2 +- .../ImpossibleVersionRangeLib/cabal.out | 2 +- .../Fields/InvalidTestedWithRange/cabal.out | 2 +- .../Fields/LanguageAsExtension/cabal.out | 2 +- .../Fields/NoBuildTypeSpecified/cabal.out | 2 +- .../Fields/NoCategory/cabal.out | 2 +- .../Fields/NoCustom/cabal.out | 2 +- .../Fields/NoDescription/cabal.out | 2 +- .../Fields/NoMaintainer/cabal.out | 2 +- .../Fields/NoSynopsis/cabal.out | 2 +- .../Fields/NoZPrefix/cabal.out | 2 +- .../Fields/ShortDescription/cabal.out | 2 +- .../Fields/UnknownCompiler/cabal.out | 2 +- .../Fields/UnknownExtension/cabal.out | 2 +- .../Fields/UnknownLanguage/cabal.out | 2 +- .../GHCOptions/GHCOptions/cabal.out | 2 +- .../GHCOptions/GHCProfOptions/cabal.out | 2 +- .../GHCOptions/GHCSharedOptions/cabal.out | 2 +- .../GHCOptions/NoWarnFlagManual/cabal.out | 3 +- .../GHCOptions/NoWarnFlagOut/cabal.out | 3 +- .../License/Compatibility/cabal.out | 2 +- .../License/NoFileSpecified/cabal.out | 2 +- .../License/NoLicense/cabal.out | 2 +- .../License/NoneLicense/cabal.out | 2 +- .../License/SuspiciousLicense/cabal.out | 2 +- .../License/SuspiciousVersion/cabal.out | 2 +- .../License/UnknownLicence/cabal.out | 2 +- .../License/WarnAllRightsReserved/cabal.out | 2 +- .../Paths/AbsolutePath/cabal.out | 6 +- .../Paths/DistPoint/cabal.out | 2 +- .../Paths/InvalidWin/cabal.out | 2 +- .../Paths/RecursiveGlobInRoot/cabal.out | 6 +- .../RelativeOutsideInner/cabal.out | 4 +- .../Sanity/AutogenExposedOther/cabal.out | 2 +- .../AutogenExposedOtherBenchmark/cabal.out | 2 +- .../Sanity/AutogenExposedOtherExe/cabal.out | 2 +- .../AutogenExposedOtherTestsuite/cabal.out | 2 +- .../Sanity/AutogenIncludes/cabal.out | 2 +- .../Sanity/AutogenIncludesBenchmark/cabal.out | 2 +- .../Sanity/AutogenIncludesExe/cabal.out | 2 +- .../Sanity/AutogenIncludesTestsuite/cabal.out | 2 +- .../Sanity/CMainIsVersion/cabal.out | 2 +- .../Sanity/CMainIsVersionTestsuite/cabal.out | 2 +- .../Sanity/MalformedMainIs/cabal.out | 2 +- .../Sanity/MalformedMainIsBenchmark/cabal.out | 2 +- .../Sanity/MalformedMainIsTestsuite/cabal.out | 2 +- .../ConfiguredPackage/Sanity/NoBody/cabal.out | 4 +- .../Sanity/NoDupNames/cabal.out | 2 +- .../Sanity/NoExposedModules/cabal.out | 2 +- .../Sanity/NoInternalNameClash/cabal.out | 2 +- .../Sanity/NoMainIs/cabal.out | 2 +- .../Sanity/VersionSignatures/cabal.out | 2 +- .../SourceRepos/NoGoodRelative/cabal.out | 2 +- .../SourceRepos/NoLocation/cabal.out | 2 +- .../SourceRepos/NoModuleCVS/cabal.out | 2 +- .../SourceRepos/NoType/cabal.out | 2 +- .../SourceRepos/NonRecognisedRepo/cabal.out | 2 +- .../SourceRepos/SubdirRelative/cabal.out | 2 +- .../SourceRepos/ThisTag/cabal.out | 2 +- .../Check/DifferentGhcOptions/cabal.out | 8 +- .../Check/IgnoreWarning/Missing/cabal.out | 4 + .../Check/IgnoreWarning/Missing/cabal.test.hs | 4 + .../Check/IgnoreWarning/Missing/pkg.cabal | 13 + .../Check/IgnoreWarning/Ok/cabal.out | 2 + .../Check/IgnoreWarning/Ok/cabal.test.hs | 4 + .../Check/IgnoreWarning/Ok/pkg.cabal | 13 + .../PackageTests/Check/InvalidGlob/cabal.out | 4 +- .../Check/MissingGlobDirectory/cabal.out | 8 +- .../Check/MissingGlobDirectory2/cabal.out | 6 +- .../Check/MultiDotGlob2.2/check.out | 6 +- .../Check/NoGlobMatches/cabal.out | 2 +- .../Conditionals/UnknownArch/cabal.out | 2 +- .../Conditionals/UnknownCompiler/cabal.out | 2 +- .../Conditionals/UnknownOS/cabal.out | 2 +- .../DevOnlyFlags/DebugFlag/cabal.out | 2 +- .../DevOnlyFlags/ElseCheck/cabal.out | 2 +- .../DevOnlyFlags/FDeferTypeErrors/cabal.out | 2 +- .../NonConfCheck/DevOnlyFlags/Jn/cabal.out | 2 +- .../DevOnlyFlags/Profiling/cabal.out | 2 +- .../DevOnlyFlags/WError/cabal.out | 2 +- .../NonConfCheck/DuplicatedModules/cabal.out | 2 +- .../NonConfCheck/PackageVersions/cabal.out | 2 +- .../PackageVersionsInternalSimple/cabal.out | 4 +- .../PackageVersionsLibInt/cabal.out | 4 +- .../NonConfCheck/PathsExtensions/cabal.out | 4 +- .../Check/NonConfCheck/SetupBounds/cabal.out | 2 +- .../Check/NonConfCheck/UnusedFlags/cabal.out | 2 +- .../Check/PackageFiles/BOM/cabal.out | 4 +- .../PackageFiles/ExtensionMatch/cabal.out | 2 +- .../Check/PackageFiles/FileName/cabal.out | 2 +- .../Check/PackageFiles/LocalPaths/cabal.out | 2 +- .../ChangeLog/NotIncluded/V1.12/cabal.out | 2 +- .../ChangeLog/NotIncluded/V3.0/cabal.out | 2 +- .../ChangeLog/WrongField/V1.12/cabal.out | 2 +- .../ChangeLog/WrongField/V3.0/cabal.out | 2 +- .../PackageFiles/NoConfigureFile/cabal.out | 2 +- .../PackageFiles/NoLicenseFile/cabal.out | 2 +- .../Check/PackageFiles/NoSetupFile/cabal.out | 2 +- .../Check/PackageFiles/PathTooLong/cabal.out | 2 +- .../Check/PackageFiles/VCSInfo/cabal.out | 2 +- .../PackageTests/CustomPlain/setup.out | 2 +- .../BuildDependsBad/setup.cabal.out | 2 +- .../BuildDependsBad/setup.out | 2 +- .../BuildToolDependsBad/setup.cabal.out | 2 +- .../BuildToolDependsBad/setup.out | 2 +- .../BuildToolsBad/setup.cabal.out | 2 +- .../InternalVersions/BuildToolsBad/setup.out | 2 +- .../Regression/T3847/setup.cabal.out | 2 +- .../PackageTests/Regression/T3847/setup.out | 2 +- .../ShowBuildInfo/Complex/single.out | 10 +- changelog.d/pr-check-ignore | 18 + doc/cabal-commands.rst | 275 +++++----- 172 files changed, 1024 insertions(+), 427 deletions(-) create mode 100644 Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs create mode 100644 cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/cabal.out create mode 100644 cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/cabal.test.hs create mode 100644 cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/pkg.cabal create mode 100644 cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/cabal.out create mode 100644 cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/cabal.test.hs create mode 100644 cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/pkg.cabal create mode 100644 changelog.d/pr-check-ignore diff --git a/Cabal-tests/Cabal-tests.cabal b/Cabal-tests/Cabal-tests.cabal index c2e3047da04..5eb3685b054 100644 --- a/Cabal-tests/Cabal-tests.cabal +++ b/Cabal-tests/Cabal-tests.cabal @@ -35,6 +35,7 @@ test-suite unit-tests UnitTests.Distribution.Compat.Graph UnitTests.Distribution.Compat.Time UnitTests.Distribution.Described + UnitTests.Distribution.PackageDescription.Check UnitTests.Distribution.PkgconfigVersion UnitTests.Distribution.Simple.Command UnitTests.Distribution.Simple.Glob diff --git a/Cabal-tests/tests/ParserTests/regressions/all-upper-bound.check b/Cabal-tests/tests/ParserTests/regressions/all-upper-bound.check index ad65af510aa..2d3e1b0e332 100644 --- a/Cabal-tests/tests/ParserTests/regressions/all-upper-bound.check +++ b/Cabal-tests/tests/ParserTests/regressions/all-upper-bound.check @@ -1,4 +1,4 @@ -On library, these packages miss upper bounds: +[missing-upper-bounds] On library, these packages miss upper bounds: - somelib - alphalib - betalib diff --git a/Cabal-tests/tests/ParserTests/regressions/assoc-cpp-options.check b/Cabal-tests/tests/ParserTests/regressions/assoc-cpp-options.check index ed0edf29738..3ceb8ca855f 100644 --- a/Cabal-tests/tests/ParserTests/regressions/assoc-cpp-options.check +++ b/Cabal-tests/tests/ParserTests/regressions/assoc-cpp-options.check @@ -1 +1 @@ -'cpp-options: -traditional' is not a portable C-preprocessor flag. +[cpp-options] 'cpp-options: -traditional' is not a portable C-preprocessor flag. diff --git a/Cabal-tests/tests/ParserTests/regressions/bad-glob-syntax.check b/Cabal-tests/tests/ParserTests/regressions/bad-glob-syntax.check index 5f52530791f..75b74ffb41d 100644 --- a/Cabal-tests/tests/ParserTests/regressions/bad-glob-syntax.check +++ b/Cabal-tests/tests/ParserTests/regressions/bad-glob-syntax.check @@ -1,2 +1,2 @@ -In the 'extra-source-files' field: invalid file glob 'foo/*/bar'. A wildcard '**' is only allowed as the final parent directory. Stars must not otherwise appear in the parent directories. -In the 'extra-source-files' field: invalid file glob 'foo/blah-*.hs'. Wildcards '*' may only totally replace the file's base name, not only parts of it. +[glob-syntax-error] In the 'extra-source-files' field: invalid file glob 'foo/*/bar'. A wildcard '**' is only allowed as the final parent directory. Stars must not otherwise appear in the parent directories. +[glob-syntax-error] In the 'extra-source-files' field: invalid file glob 'foo/blah-*.hs'. Wildcards '*' may only totally replace the file's base name, not only parts of it. diff --git a/Cabal-tests/tests/ParserTests/regressions/cc-options-with-optimization.check b/Cabal-tests/tests/ParserTests/regressions/cc-options-with-optimization.check index 16cfdb25554..092e0018bac 100644 --- a/Cabal-tests/tests/ParserTests/regressions/cc-options-with-optimization.check +++ b/Cabal-tests/tests/ParserTests/regressions/cc-options-with-optimization.check @@ -1 +1 @@ -'cc-options: -O[n]' is generally not needed. When building with optimisations Cabal automatically adds '-O2' for C code. Setting it yourself interferes with the --disable-optimization flag. +[option-opt-c] 'cc-options: -O[n]' is generally not needed. When building with optimisations Cabal automatically adds '-O2' for C code. Setting it yourself interferes with the --disable-optimization flag. diff --git a/Cabal-tests/tests/ParserTests/regressions/cxx-options-with-optimization.check b/Cabal-tests/tests/ParserTests/regressions/cxx-options-with-optimization.check index 822bea388f5..04edbcc84dc 100644 --- a/Cabal-tests/tests/ParserTests/regressions/cxx-options-with-optimization.check +++ b/Cabal-tests/tests/ParserTests/regressions/cxx-options-with-optimization.check @@ -1 +1 @@ -'cxx-options: -O[n]' is generally not needed. When building with optimisations Cabal automatically adds '-O2' for C++ code. Setting it yourself interferes with the --disable-optimization flag. +[option-opt-c] 'cxx-options: -O[n]' is generally not needed. When building with optimisations Cabal automatically adds '-O2' for C++ code. Setting it yourself interferes with the --disable-optimization flag. diff --git a/Cabal-tests/tests/ParserTests/regressions/decreasing-indentation.check b/Cabal-tests/tests/ParserTests/regressions/decreasing-indentation.check index 8fa4aa3b13e..3758134dd5d 100644 --- a/Cabal-tests/tests/ParserTests/regressions/decreasing-indentation.check +++ b/Cabal-tests/tests/ParserTests/regressions/decreasing-indentation.check @@ -1,2 +1,2 @@ decreasing-indentation.cabal:38:3: Inconsistent indentation. Indentation jumps at lines 38, 49, 56, 57, 69 -No 'main-is' field found for executable warnings +[no-main-is] No 'main-is' field found for executable warnings diff --git a/Cabal-tests/tests/ParserTests/regressions/denormalised-paths.check b/Cabal-tests/tests/ParserTests/regressions/denormalised-paths.check index 9b631589990..341645e243d 100644 --- a/Cabal-tests/tests/ParserTests/regressions/denormalised-paths.check +++ b/Cabal-tests/tests/ParserTests/regressions/denormalised-paths.check @@ -1,14 +1,14 @@ -'hs-source-dirs: ../../assoc/src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'. -The 'subdir' field of a source-repository is not a good relative path: "trailing same directory segment: ." -'extra-source-files: files/**/*.txt/' is not a good relative path: "trailing slash" -'extra-source-files: files/../foo.txt' is not a good relative path: "parent directory segment: .." -'hs-source-dirs: ../../assoc/src' is not a good relative path: "parent directory segment: .." -'hs-source-dirs: src/.' is not a good relative path: "trailing same directory segment: ." -'hs-source-dirs: src/../../assoc/src' is not a good relative path: "parent directory segment: .." -'hs-source-dirs: src/../src' is not a good relative path: "parent directory segment: .." -'license-file: .' is not a good relative path: "trailing dot segment" -'license-file: LICENSE2/' is not a good relative path: "trailing slash" -The path 'C:foo/bar' is invalid on Windows, which would cause portability problems for this package. Windows file names cannot contain any of the characters ":*?<>|" and there a few reserved names including "aux", "nul", "con", "prn", "com1-9", "lpt1-9" and "clock$". -The path 'c/**/*.c' is invalid on Windows, which would cause portability problems for this package. Windows file names cannot contain any of the characters ":*?<>|" and there a few reserved names including "aux", "nul", "con", "prn", "com1-9", "lpt1-9" and "clock$". -The path 'files/<>/*.txt' is invalid on Windows, which would cause portability problems for this package. Windows file names cannot contain any of the characters ":*?<>|" and there a few reserved names including "aux", "nul", "con", "prn", "com1-9", "lpt1-9" and "clock$". -The path '||s' is invalid on Windows, which would cause portability problems for this package. Windows file names cannot contain any of the characters ":*?<>|" and there a few reserved names including "aux", "nul", "con", "prn", "com1-9", "lpt1-9" and "clock$". +[relative-path-outside] 'hs-source-dirs: ../../assoc/src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'. +[repo-malformed-subdir] The 'subdir' field of a source-repository is not a good relative path: "trailing same directory segment: ." +[malformed-relative-path] 'extra-source-files: files/**/*.txt/' is not a good relative path: "trailing slash" +[malformed-relative-path] 'extra-source-files: files/../foo.txt' is not a good relative path: "parent directory segment: .." +[malformed-relative-path] 'hs-source-dirs: ../../assoc/src' is not a good relative path: "parent directory segment: .." +[malformed-relative-path] 'hs-source-dirs: src/.' is not a good relative path: "trailing same directory segment: ." +[malformed-relative-path] 'hs-source-dirs: src/../../assoc/src' is not a good relative path: "parent directory segment: .." +[malformed-relative-path] 'hs-source-dirs: src/../src' is not a good relative path: "parent directory segment: .." +[malformed-relative-path] 'license-file: .' is not a good relative path: "trailing dot segment" +[malformed-relative-path] 'license-file: LICENSE2/' is not a good relative path: "trailing slash" +[invalid-path-win] The path 'C:foo/bar' is invalid on Windows, which would cause portability problems for this package. Windows file names cannot contain any of the characters ":*?<>|" and there a few reserved names including "aux", "nul", "con", "prn", "com1-9", "lpt1-9" and "clock$". +[invalid-path-win] The path 'c/**/*.c' is invalid on Windows, which would cause portability problems for this package. Windows file names cannot contain any of the characters ":*?<>|" and there a few reserved names including "aux", "nul", "con", "prn", "com1-9", "lpt1-9" and "clock$". +[invalid-path-win] The path 'files/<>/*.txt' is invalid on Windows, which would cause portability problems for this package. Windows file names cannot contain any of the characters ":*?<>|" and there a few reserved names including "aux", "nul", "con", "prn", "com1-9", "lpt1-9" and "clock$". +[invalid-path-win] The path '||s' is invalid on Windows, which would cause portability problems for this package. Windows file names cannot contain any of the characters ":*?<>|" and there a few reserved names including "aux", "nul", "con", "prn", "com1-9", "lpt1-9" and "clock$". diff --git a/Cabal-tests/tests/ParserTests/regressions/extensions-paths-5054.check b/Cabal-tests/tests/ParserTests/regressions/extensions-paths-5054.check index d6a6dac2aa2..a78df59976a 100644 --- a/Cabal-tests/tests/ParserTests/regressions/extensions-paths-5054.check +++ b/Cabal-tests/tests/ParserTests/regressions/extensions-paths-5054.check @@ -1 +1 @@ -Packages using RebindableSyntax with OverloadedStrings or OverloadedLists in default-extensions, in conjunction with the autogenerated module Paths_*, are known to cause compile failures with Cabal < 2.2. To use these default-extensions with a Paths_* autogen module, specify at least 'cabal-version: 2.2'. +[rebindable-clash-paths] Packages using RebindableSyntax with OverloadedStrings or OverloadedLists in default-extensions, in conjunction with the autogenerated module Paths_*, are known to cause compile failures with Cabal < 2.2. To use these default-extensions with a Paths_* autogen module, specify at least 'cabal-version: 2.2'. diff --git a/Cabal-tests/tests/ParserTests/regressions/ghc-option-j.check b/Cabal-tests/tests/ParserTests/regressions/ghc-option-j.check index 8e6ed9f432a..cd88496c706 100644 --- a/Cabal-tests/tests/ParserTests/regressions/ghc-option-j.check +++ b/Cabal-tests/tests/ParserTests/regressions/ghc-option-j.check @@ -1,2 +1,2 @@ -'ghc-options: -j[N]' can make sense for a particular user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. -'ghc-shared-options: -j[N]' can make sense for a particular user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. +[unneeded-j] 'ghc-options: -j[N]' can make sense for a particular user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. +[unneeded-j] 'ghc-shared-options: -j[N]' can make sense for a particular user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-6288-d.check b/Cabal-tests/tests/ParserTests/regressions/issue-6288-d.check index 5246b90363e..64c183826b5 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-6288-d.check +++ b/Cabal-tests/tests/ParserTests/regressions/issue-6288-d.check @@ -1 +1 @@ -Packages using 'cabal-version: >= 1.10' and before 'cabal-version: 3.4' must specify the 'default-language' field for each component (e.g. Haskell98 or Haskell2010). If a component uses different languages in different modules then list the other ones in the 'other-languages' field. +[no-default-language] Packages using 'cabal-version: >= 1.10' and before 'cabal-version: 3.4' must specify the 'default-language' field for each component (e.g. Haskell98 or Haskell2010). If a component uses different languages in different modules then list the other ones in the 'other-languages' field. diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-774.check b/Cabal-tests/tests/ParserTests/regressions/issue-774.check index 84bf5272856..83f13c20c87 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-774.check +++ b/Cabal-tests/tests/ParserTests/regressions/issue-774.check @@ -1,6 +1,6 @@ issue-774.cabal:13:22: Packages with 'cabal-version: 1.12' or later should specify a specific version of the Cabal spec of the form 'cabal-version: x.y'. Use 'cabal-version: 1.12'. -'ghc-options: -rtsopts' has no effect for libraries. It should only be used for executables. -'ghc-options: -with-rtsopts' has no effect for libraries. It should only be used for executables. -No 'category' field. -No 'maintainer' field. -The 'license' field is missing or is NONE. +[option-rtsopts] 'ghc-options: -rtsopts' has no effect for libraries. It should only be used for executables. +[option-with-rtsopts] 'ghc-options: -with-rtsopts' has no effect for libraries. It should only be used for executables. +[no-category] No 'category' field. +[no-maintainer] No 'maintainer' field. +[license-none] The 'license' field is missing or is NONE. diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-7776-a.check b/Cabal-tests/tests/ParserTests/regressions/issue-7776-a.check index f19bdb4a795..34e46f90787 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-7776-a.check +++ b/Cabal-tests/tests/ParserTests/regressions/issue-7776-a.check @@ -1 +1 @@ -Potential duplicate modules (subject to conditionals) in library: GHC.Hs.Type +[maybe-duplicate-modules] Potential duplicate modules (subject to conditionals) in library: GHC.Hs.Type diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-7776-b.check b/Cabal-tests/tests/ParserTests/regressions/issue-7776-b.check index d3839c3621d..197325be283 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-7776-b.check +++ b/Cabal-tests/tests/ParserTests/regressions/issue-7776-b.check @@ -1 +1 @@ -Potential duplicate modules (subject to conditionals) in benchmark: Data.Hashable.RandomSource +[maybe-duplicate-modules] Potential duplicate modules (subject to conditionals) in benchmark: Data.Hashable.RandomSource diff --git a/Cabal-tests/tests/ParserTests/regressions/issue-7776-c.check b/Cabal-tests/tests/ParserTests/regressions/issue-7776-c.check index 911df91c797..1e360807071 100644 --- a/Cabal-tests/tests/ParserTests/regressions/issue-7776-c.check +++ b/Cabal-tests/tests/ParserTests/regressions/issue-7776-c.check @@ -1 +1 @@ -Duplicate modules in library: GHC.Hs.Type +[duplicate-modules] Duplicate modules in library: GHC.Hs.Type diff --git a/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.check b/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.check index 281f2cd1c09..4dc5b5ed527 100644 --- a/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.check +++ b/Cabal-tests/tests/ParserTests/regressions/multiple-libs-2.check @@ -1,6 +1,6 @@ multiple-libs-2.cabal:17:3: The field "visibility" is available only since the Cabal specification version 3.0. This field will be ignored. -No 'category' field. -No 'maintainer' field. -No 'description' field. -The 'license' field is missing or is NONE. -The dependency 'build-depends: base' does not specify an upper bound on the version number. Each major release of the 'base' package changes the API in various ways and most packages will need some changes to compile with it. The recommended practice is to specify an upper bound on the version of the 'base' package. This ensures your package will continue to build when a new major version of the 'base' package is released. If you are not sure what upper bound to use then use the next major version. For example if you have tested your package with 'base' version 4.5 and 4.6 then use 'build-depends: base >= 4.5 && < 4.7'. +[no-category] No 'category' field. +[no-maintainer] No 'maintainer' field. +[no-description] No 'description' field. +[license-none] The 'license' field is missing or is NONE. +[missing-bounds-important] The dependency 'build-depends: base' does not specify an upper bound on the version number. Each major release of the 'base' package changes the API in various ways and most packages will need some changes to compile with it. The recommended practice is to specify an upper bound on the version of the 'base' package. This ensures your package will continue to build when a new major version of the 'base' package is released. If you are not sure what upper bound to use then use the next major version. For example if you have tested your package with 'base' version 4.5 and 4.6 then use 'build-depends: base >= 4.5 && < 4.7'. diff --git a/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.check b/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.check index 6a21d7ccae8..6414561ee0c 100644 --- a/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.check +++ b/Cabal-tests/tests/ParserTests/regressions/nothing-unicode.check @@ -1,6 +1,6 @@ -No 'category' field. -No 'maintainer' field. -No 'description' field. -The 'license' field is missing or is NONE. -Suspicious flag names: 無. To avoid ambiguity in command line interfaces, a flag shouldn't start with a dash. Also for better compatibility, flag names shouldn't contain non-ascii characters. -Non ascii custom fields: x-無. For better compatibility, custom field names shouldn't contain non-ascii characters. +[no-category] No 'category' field. +[no-maintainer] No 'maintainer' field. +[no-description] No 'description' field. +[license-none] The 'license' field is missing or is NONE. +[suspicious-flag] Suspicious flag names: 無. To avoid ambiguity in command line interfaces, a flag shouldn't start with a dash. Also for better compatibility, flag names shouldn't contain non-ascii characters. +[non-ascii] Non ascii custom fields: x-無. For better compatibility, custom field names shouldn't contain non-ascii characters. diff --git a/Cabal-tests/tests/ParserTests/regressions/pre-1.6-glob.check b/Cabal-tests/tests/ParserTests/regressions/pre-1.6-glob.check index 3c69e99a323..6f653531c14 100644 --- a/Cabal-tests/tests/ParserTests/regressions/pre-1.6-glob.check +++ b/Cabal-tests/tests/ParserTests/regressions/pre-1.6-glob.check @@ -1 +1 @@ -In the 'extra-source-files' field: invalid file glob 'foo/*.hs'. Using star wildcards requires 'cabal-version: >= 1.6'. Alternatively if you require compatibility with earlier Cabal versions then list all the files explicitly. +[glob-syntax-error] In the 'extra-source-files' field: invalid file glob 'foo/*.hs'. Using star wildcards requires 'cabal-version: >= 1.6'. Alternatively if you require compatibility with earlier Cabal versions then list all the files explicitly. diff --git a/Cabal-tests/tests/ParserTests/regressions/pre-2.4-globstar.check b/Cabal-tests/tests/ParserTests/regressions/pre-2.4-globstar.check index ac3bd4bc76d..00cf186a699 100644 --- a/Cabal-tests/tests/ParserTests/regressions/pre-2.4-globstar.check +++ b/Cabal-tests/tests/ParserTests/regressions/pre-2.4-globstar.check @@ -1,3 +1,3 @@ -In the 'data-files' field: invalid file glob 'foo/**/*.dat'. Using the double-star syntax requires 'cabal-version: 2.4' or greater. Alternatively, for compatibility with earlier Cabal versions, list the included directories explicitly. -In the 'extra-doc-files' field: invalid file glob 'foo/**/*.html'. Using the double-star syntax requires 'cabal-version: 2.4' or greater. Alternatively, for compatibility with earlier Cabal versions, list the included directories explicitly. -In the 'extra-source-files' field: invalid file glob 'foo/**/*.hs'. Using the double-star syntax requires 'cabal-version: 2.4' or greater. Alternatively, for compatibility with earlier Cabal versions, list the included directories explicitly. +[glob-syntax-error] In the 'data-files' field: invalid file glob 'foo/**/*.dat'. Using the double-star syntax requires 'cabal-version: 2.4' or greater. Alternatively, for compatibility with earlier Cabal versions, list the included directories explicitly. +[glob-syntax-error] In the 'extra-doc-files' field: invalid file glob 'foo/**/*.html'. Using the double-star syntax requires 'cabal-version: 2.4' or greater. Alternatively, for compatibility with earlier Cabal versions, list the included directories explicitly. +[glob-syntax-error] In the 'extra-source-files' field: invalid file glob 'foo/**/*.hs'. Using the double-star syntax requires 'cabal-version: 2.4' or greater. Alternatively, for compatibility with earlier Cabal versions, list the included directories explicitly. diff --git a/Cabal-tests/tests/ParserTests/regressions/pre-3.8-globstar-literal.check b/Cabal-tests/tests/ParserTests/regressions/pre-3.8-globstar-literal.check index 73250aca7aa..98c6eebac9e 100644 --- a/Cabal-tests/tests/ParserTests/regressions/pre-3.8-globstar-literal.check +++ b/Cabal-tests/tests/ParserTests/regressions/pre-3.8-globstar-literal.check @@ -1 +1 @@ -In the 'extra-source-files' field: invalid file glob 'foo/**/bar'. Prior to 'cabal-version: 3.8' if a wildcard '**' is used as a parent directory, the file's base name must be a wildcard '*'. +[glob-syntax-error] In the 'extra-source-files' field: invalid file glob 'foo/**/bar'. Prior to 'cabal-version: 3.8' if a wildcard '**' is used as a parent directory, the file's base name must be a wildcard '*'. diff --git a/Cabal-tests/tests/ParserTests/regressions/public-multilib-1.check b/Cabal-tests/tests/ParserTests/regressions/public-multilib-1.check index 3d4f13970d7..c1ca12187d8 100644 --- a/Cabal-tests/tests/ParserTests/regressions/public-multilib-1.check +++ b/Cabal-tests/tests/ParserTests/regressions/public-multilib-1.check @@ -1,2 +1,2 @@ -No 'maintainer' field. -No 'description' field. +[no-maintainer] No 'maintainer' field. +[no-description] No 'description' field. diff --git a/Cabal-tests/tests/ParserTests/regressions/public-multilib-2.check b/Cabal-tests/tests/ParserTests/regressions/public-multilib-2.check index 3d4f13970d7..c1ca12187d8 100644 --- a/Cabal-tests/tests/ParserTests/regressions/public-multilib-2.check +++ b/Cabal-tests/tests/ParserTests/regressions/public-multilib-2.check @@ -1,2 +1,2 @@ -No 'maintainer' field. -No 'description' field. +[no-maintainer] No 'maintainer' field. +[no-description] No 'description' field. diff --git a/Cabal-tests/tests/UnitTests.hs b/Cabal-tests/tests/UnitTests.hs index cf4128c05c9..cc0099175a8 100644 --- a/Cabal-tests/tests/UnitTests.hs +++ b/Cabal-tests/tests/UnitTests.hs @@ -15,6 +15,7 @@ import Distribution.Compat.Time import qualified UnitTests.Distribution.Compat.Time import qualified UnitTests.Distribution.Compat.Graph +import qualified UnitTests.Distribution.PackageDescription.Check import qualified UnitTests.Distribution.Simple.Command import qualified UnitTests.Distribution.Simple.Glob import qualified UnitTests.Distribution.Simple.Program.GHC @@ -62,6 +63,8 @@ tests mtimeChangeCalibrated = UnitTests.Distribution.Utils.Json.tests , testGroup "Distribution.Utils.NubList" UnitTests.Distribution.Utils.NubList.tests + , testGroup "Distribution.PackageDescription.Check" + UnitTests.Distribution.PackageDescription.Check.tests , testGroup "Distribution.Utils.ShortText" UnitTests.Distribution.Utils.ShortText.tests , testGroup "Distribution.System" diff --git a/Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs b/Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs new file mode 100644 index 00000000000..2665b49a6de --- /dev/null +++ b/Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs @@ -0,0 +1,34 @@ +module UnitTests.Distribution.PackageDescription.Check (tests) where + +import Distribution.Compat.Prelude.Internal +import Prelude () + +import Distribution.PackageDescription.Check + +import Test.Tasty +import Test.Tasty.HUnit + +-- instances +import Test.QuickCheck.Instances.Cabal () + + +tests :: [TestTree] +tests = + [ testCase "Unique ignore strings" (uniqueNames @?= True) + , testCase "Short ignore identifiers" (longerThan @?= []) + , testCase "Parsimonious '-' use" (usingTooManyDashes @?= []) + ] + where + allExplanationIdStrings :: [CheckExplanationIDString] + allExplanationIdStrings = map ppCheckExplanationId [minBound..maxBound] + + uniqueNames :: Bool + uniqueNames = length allExplanationIdStrings == length (nub allExplanationIdStrings) + + longerThan :: [CheckExplanationIDString] + longerThan = filter ((>25). length) allExplanationIdStrings + + usingTooManyDashes :: [CheckExplanationIDString] + usingTooManyDashes = filter ((>2) . length . filter (=='-')) + allExplanationIdStrings + diff --git a/Cabal/src/Distribution/PackageDescription/Check.hs b/Cabal/src/Distribution/PackageDescription/Check.hs index fb3c05a64b6..1893d05014c 100644 --- a/Cabal/src/Distribution/PackageDescription/Check.hs +++ b/Cabal/src/Distribution/PackageDescription/Check.hs @@ -23,12 +23,17 @@ module Distribution.PackageDescription.Check ( -- * Package Checking CheckExplanation (..) + , CheckExplanationID + , CheckExplanationIDString , PackageCheck (..) , checkPackage , checkConfiguredPackage , wrapParseWarning , ppPackageCheck + , ppCheckExplanationId , isHackageDistError + , filterPackageChecksById + , filterPackageChecksByIdString -- ** Checking package contents , checkPackageFiles @@ -52,6 +57,7 @@ import Distribution.PackageDescription.Check.Conditional import Distribution.PackageDescription.Check.Monad import Distribution.PackageDescription.Check.Paths import Distribution.PackageDescription.Check.Target +import Distribution.PackageDescription.Check.Warning import Distribution.Parsec.Warning (PWarning) import Distribution.Pretty (prettyShow) import Distribution.Simple.Glob @@ -416,19 +422,19 @@ checkPackageDescription -- § Fields check. checkNull category_ - (PackageDistSuspicious $ MissingField CEFCategory) + (PackageDistSuspicious MissingFieldCategory) checkNull maintainer_ - (PackageDistSuspicious $ MissingField CEFMaintainer) + (PackageDistSuspicious MissingFieldMaintainer) checkP (ShortText.null synopsis_ && not (ShortText.null description_)) - (PackageDistSuspicious $ MissingField CEFSynopsis) + (PackageDistSuspicious MissingFieldSynopsis) checkP (ShortText.null description_ && not (ShortText.null synopsis_)) - (PackageDistSuspicious $ MissingField CEFDescription) + (PackageDistSuspicious MissingFieldDescription) checkP (all ShortText.null [synopsis_, description_]) - (PackageDistInexcusable $ MissingField CEFSynOrDesc) + (PackageDistInexcusable MissingFieldSynOrDesc) checkP (ShortText.length synopsis_ > 80) (PackageDistSuspicious SynopsisTooLong) diff --git a/Cabal/src/Distribution/PackageDescription/Check/Monad.hs b/Cabal/src/Distribution/PackageDescription/Check/Monad.hs index 9e375e8d9b8..23d37570800 100644 --- a/Cabal/src/Distribution/PackageDescription/Check/Monad.hs +++ b/Cabal/src/Distribution/PackageDescription/Check/Monad.hs @@ -22,7 +22,6 @@ module Distribution.PackageDescription.Check.Monad , TargetAnnotation (..) , PackageCheck (..) , CheckExplanation (..) - , CEField (..) , CEType (..) , WarnLang (..) , CheckCtx (..) diff --git a/Cabal/src/Distribution/PackageDescription/Check/Warning.hs b/Cabal/src/Distribution/PackageDescription/Check/Warning.hs index a8d9ac78195..ff80d55684d 100644 --- a/Cabal/src/Distribution/PackageDescription/Check/Warning.hs +++ b/Cabal/src/Distribution/PackageDescription/Check/Warning.hs @@ -15,14 +15,18 @@ module Distribution.PackageDescription.Check.Warning ( -- * Types and constructors PackageCheck (..) , CheckExplanation (..) - , CEField (..) + , CheckExplanationID + , CheckExplanationIDString , CEType (..) , WarnLang (..) -- * Operations , ppPackageCheck + , ppCheckExplanationId , isHackageDistError , extractCheckExplantion + , filterPackageChecksById + , filterPackageChecksByIdString ) where import Distribution.Compat.Prelude @@ -50,6 +54,7 @@ import Distribution.Utils.Path ) import Language.Haskell.Extension (Extension) +import qualified Data.Either as Either import qualified Data.List as List import qualified Data.Set as Set @@ -89,7 +94,12 @@ data PackageCheck -- | Pretty printing 'PackageCheck'. ppPackageCheck :: PackageCheck -> String -ppPackageCheck e = ppExplanation (explanation e) +ppPackageCheck e = + let ex = explanation e + in "[" + ++ (ppCheckExplanationId . checkExplanationId) ex + ++ "] " + ++ ppExplanation ex -- | Broken 'Show' instance (not bijective with Read), alas external packages -- depend on it. @@ -105,11 +115,31 @@ isHackageDistError = \case (PackageDistSuspicious{}) -> False (PackageDistSuspiciousWarn{}) -> False +-- | Filter Package Check by CheckExplanationID. +filterPackageChecksById + :: [PackageCheck] -- Original checks. + -> [CheckExplanationID] -- IDs to omit. + -> [PackageCheck] +filterPackageChecksById cs is = filter ff cs + where + ff :: PackageCheck -> Bool + ff c = + flip notElem is + . checkExplanationId + . extractCheckExplantion + $ c + +-- | Filter Package Check by Check explanation /string/. +filterPackageChecksByIdString + :: [PackageCheck] -- Original checks. + -> [CheckExplanationIDString] -- IDs to omit, in @String@ format. + -> ([PackageCheck], [CheckExplanationIDString]) +-- Filtered checks plus unrecognised id strings. +filterPackageChecksByIdString cs ss = + let (es, is) = Either.partitionEithers $ map readExplanationID ss + in (filterPackageChecksById cs is, es) + -- | Explanations of 'PackageCheck`'s errors/warnings. --- --- ☞ N.B: if you add a constructor here, remeber to change the documentation --- in @doc/cabal-commands.rst@! Same if you modify it, you need to adjust the --- documentation! data CheckExplanation = ParseWarning FilePath PWarning | NoNameField @@ -141,7 +171,11 @@ data CheckExplanation | UnknownExtensions [String] | LanguagesAsExtension [String] | DeprecatedExtensions [(Extension, Maybe Extension)] - | MissingField CEField + | MissingFieldCategory + | MissingFieldMaintainer + | MissingFieldSynopsis + | MissingFieldDescription + | MissingFieldSynOrDesc | SynopsisTooLong | ShortDesc | InvalidTestWith [Dependency] @@ -263,6 +297,438 @@ extractCheckExplantion (PackageDistSuspicious e) = e extractCheckExplantion (PackageDistSuspiciousWarn e) = e extractCheckExplantion (PackageDistInexcusable e) = e +-- | Identifier for the speficic 'CheckExplanation'. This ensures `--ignore` +-- can output a warning on unrecognised values. +data CheckExplanationID + = CIParseWarning + | CINoNameField + | CINoVersionField + | CINoTarget + | CIUnnamedInternal + | CIDuplicateSections + | CIIllegalLibraryName + | CINoModulesExposed + | CISignaturesCabal2 + | CIAutogenNotExposed + | CIAutogenIncludesNotIncluded + | CINoMainIs + | CINoHsLhsMain + | CIMainCCabal1_18 + | CIAutogenNoOther + | CIAutogenIncludesNotIncludedExe + | CITestsuiteTypeNotKnown + | CITestsuiteNotSupported + | CIBenchmarkTypeNotKnown + | CIBenchmarkNotSupported + | CINoHsLhsMainBench + | CIInvalidNameWin + | CIZPrefix + | CINoBuildType + | CINoCustomSetup + | CIUnknownCompilers + | CIUnknownLanguages + | CIUnknownExtensions + | CILanguagesAsExtension + | CIDeprecatedExtensions + | CIMissingFieldCategory + | CIMissingFieldMaintainer + | CIMissingFieldSynopsis + | CIMissingFieldDescription + | CIMissingFieldSynOrDesc + | CISynopsisTooLong + | CIShortDesc + | CIInvalidTestWith + | CIImpossibleInternalDep + | CIImpossibleInternalExe + | CIMissingInternalExe + | CINONELicense + | CINoLicense + | CIAllRightsReservedLicense + | CILicenseMessParse + | CIUnrecognisedLicense + | CIUncommonBSD4 + | CIUnknownLicenseVersion + | CINoLicenseFile + | CIUnrecognisedSourceRepo + | CIMissingType + | CIMissingLocation + | CIMissingModule + | CIMissingTag + | CISubdirRelPath + | CISubdirGoodRelPath + | CIOptFasm + | CIOptHpc + | CIOptProf + | CIOptO + | CIOptHide + | CIOptMake + | CIOptONot + | CIOptOOne + | CIOptOTwo + | CIOptSplitSections + | CIOptSplitObjs + | CIOptWls + | CIOptExts + | CIOptRts + | CIOptWithRts + | CICOptONumber + | CICOptCPP + | CIOptAlternatives + | CIRelativeOutside + | CIAbsolutePath + | CIBadRelativePath + | CIDistPoint + | CIGlobSyntaxError + | CIRecursiveGlobInRoot + | CIInvalidOnWin + | CIFilePathTooLong + | CIFilePathNameTooLong + | CIFilePathSplitTooLong + | CIFilePathEmpty + | CICVTestSuite + | CICVDefaultLanguage + | CICVDefaultLanguageComponent + | CICVExtraDocFiles + | CICVMultiLib + | CICVReexported + | CICVMixins + | CICVExtraFrameworkDirs + | CICVDefaultExtensions + | CICVExtensionsDeprecated + | CICVSources + | CICVExtraDynamic + | CICVVirtualModules + | CICVSourceRepository + | CICVExtensions + | CICVCustomSetup + | CICVExpliticDepsCustomSetup + | CICVAutogenPaths + | CICVAutogenPackageInfo + | CIGlobNoMatch + | CIGlobExactMatch + | CIGlobNoDir + | CIUnknownOS + | CIUnknownArch + | CIUnknownCompiler + | CIBaseNoUpperBounds + | CIMissingUpperBounds + | CISuspiciousFlagName + | CIDeclaredUsedFlags + | CINonASCIICustomField + | CIRebindableClashPaths + | CIRebindableClashPackageInfo + | CIWErrorUnneeded + | CIJUnneeded + | CIFDeferTypeErrorsUnneeded + | CIDynamicUnneeded + | CIProfilingUnneeded + | CIUpperBoundSetup + | CIDuplicateModule + | CIPotentialDupModule + | CIBOMStart + | CINotPackageName + | CINoDesc + | CIMultiDesc + | CIUnknownFile + | CIMissingSetupFile + | CIMissingConfigureScript + | CIUnknownDirectory + | CIMissingSourceControl + | CIMissingExpectedDocFiles + | CIWrongFieldForExpectedDocFiles + deriving (Eq, Ord, Show, Enum, Bounded) + +checkExplanationId :: CheckExplanation -> CheckExplanationID +checkExplanationId (ParseWarning{}) = CIParseWarning +checkExplanationId (NoNameField{}) = CINoNameField +checkExplanationId (NoVersionField{}) = CINoVersionField +checkExplanationId (NoTarget{}) = CINoTarget +checkExplanationId (UnnamedInternal{}) = CIUnnamedInternal +checkExplanationId (DuplicateSections{}) = CIDuplicateSections +checkExplanationId (IllegalLibraryName{}) = CIIllegalLibraryName +checkExplanationId (NoModulesExposed{}) = CINoModulesExposed +checkExplanationId (SignaturesCabal2{}) = CISignaturesCabal2 +checkExplanationId (AutogenNotExposed{}) = CIAutogenNotExposed +checkExplanationId (AutogenIncludesNotIncluded{}) = CIAutogenIncludesNotIncluded +checkExplanationId (NoMainIs{}) = CINoMainIs +checkExplanationId (NoHsLhsMain{}) = CINoHsLhsMain +checkExplanationId (MainCCabal1_18{}) = CIMainCCabal1_18 +checkExplanationId (AutogenNoOther{}) = CIAutogenNoOther +checkExplanationId (AutogenIncludesNotIncludedExe{}) = CIAutogenIncludesNotIncludedExe +checkExplanationId (TestsuiteTypeNotKnown{}) = CITestsuiteTypeNotKnown +checkExplanationId (TestsuiteNotSupported{}) = CITestsuiteNotSupported +checkExplanationId (BenchmarkTypeNotKnown{}) = CIBenchmarkTypeNotKnown +checkExplanationId (BenchmarkNotSupported{}) = CIBenchmarkNotSupported +checkExplanationId (NoHsLhsMainBench{}) = CINoHsLhsMainBench +checkExplanationId (InvalidNameWin{}) = CIInvalidNameWin +checkExplanationId (ZPrefix{}) = CIZPrefix +checkExplanationId (NoBuildType{}) = CINoBuildType +checkExplanationId (NoCustomSetup{}) = CINoCustomSetup +checkExplanationId (UnknownCompilers{}) = CIUnknownCompilers +checkExplanationId (UnknownLanguages{}) = CIUnknownLanguages +checkExplanationId (UnknownExtensions{}) = CIUnknownExtensions +checkExplanationId (LanguagesAsExtension{}) = CILanguagesAsExtension +checkExplanationId (DeprecatedExtensions{}) = CIDeprecatedExtensions +checkExplanationId (MissingFieldCategory{}) = CIMissingFieldCategory +checkExplanationId (MissingFieldMaintainer{}) = CIMissingFieldMaintainer +checkExplanationId (MissingFieldSynopsis{}) = CIMissingFieldSynopsis +checkExplanationId (MissingFieldDescription{}) = CIMissingFieldDescription +checkExplanationId (MissingFieldSynOrDesc{}) = CIMissingFieldSynOrDesc +checkExplanationId (SynopsisTooLong{}) = CISynopsisTooLong +checkExplanationId (ShortDesc{}) = CIShortDesc +checkExplanationId (InvalidTestWith{}) = CIInvalidTestWith +checkExplanationId (ImpossibleInternalDep{}) = CIImpossibleInternalDep +checkExplanationId (ImpossibleInternalExe{}) = CIImpossibleInternalExe +checkExplanationId (MissingInternalExe{}) = CIMissingInternalExe +checkExplanationId (NONELicense{}) = CINONELicense +checkExplanationId (NoLicense{}) = CINoLicense +checkExplanationId (AllRightsReservedLicense{}) = CIAllRightsReservedLicense +checkExplanationId (LicenseMessParse{}) = CILicenseMessParse +checkExplanationId (UnrecognisedLicense{}) = CIUnrecognisedLicense +checkExplanationId (UncommonBSD4{}) = CIUncommonBSD4 +checkExplanationId (UnknownLicenseVersion{}) = CIUnknownLicenseVersion +checkExplanationId (NoLicenseFile{}) = CINoLicenseFile +checkExplanationId (UnrecognisedSourceRepo{}) = CIUnrecognisedSourceRepo +checkExplanationId (MissingType{}) = CIMissingType +checkExplanationId (MissingLocation{}) = CIMissingLocation +checkExplanationId (MissingModule{}) = CIMissingModule +checkExplanationId (MissingTag{}) = CIMissingTag +checkExplanationId (SubdirRelPath{}) = CISubdirRelPath +checkExplanationId (SubdirGoodRelPath{}) = CISubdirGoodRelPath +checkExplanationId (OptFasm{}) = CIOptFasm +checkExplanationId (OptHpc{}) = CIOptHpc +checkExplanationId (OptProf{}) = CIOptProf +checkExplanationId (OptO{}) = CIOptO +checkExplanationId (OptHide{}) = CIOptHide +checkExplanationId (OptMake{}) = CIOptMake +checkExplanationId (OptONot{}) = CIOptONot +checkExplanationId (OptOOne{}) = CIOptOOne +checkExplanationId (OptOTwo{}) = CIOptOTwo +checkExplanationId (OptSplitSections{}) = CIOptSplitSections +checkExplanationId (OptSplitObjs{}) = CIOptSplitObjs +checkExplanationId (OptWls{}) = CIOptWls +checkExplanationId (OptExts{}) = CIOptExts +checkExplanationId (OptRts{}) = CIOptRts +checkExplanationId (OptWithRts{}) = CIOptWithRts +checkExplanationId (COptONumber{}) = CICOptONumber +checkExplanationId (COptCPP{}) = CICOptCPP +checkExplanationId (OptAlternatives{}) = CIOptAlternatives +checkExplanationId (RelativeOutside{}) = CIRelativeOutside +checkExplanationId (AbsolutePath{}) = CIAbsolutePath +checkExplanationId (BadRelativePath{}) = CIBadRelativePath +checkExplanationId (DistPoint{}) = CIDistPoint +checkExplanationId (GlobSyntaxError{}) = CIGlobSyntaxError +checkExplanationId (RecursiveGlobInRoot{}) = CIRecursiveGlobInRoot +checkExplanationId (InvalidOnWin{}) = CIInvalidOnWin +checkExplanationId (FilePathTooLong{}) = CIFilePathTooLong +checkExplanationId (FilePathNameTooLong{}) = CIFilePathNameTooLong +checkExplanationId (FilePathSplitTooLong{}) = CIFilePathSplitTooLong +checkExplanationId (FilePathEmpty{}) = CIFilePathEmpty +checkExplanationId (CVTestSuite{}) = CICVTestSuite +checkExplanationId (CVDefaultLanguage{}) = CICVDefaultLanguage +checkExplanationId (CVDefaultLanguageComponent{}) = CICVDefaultLanguageComponent +checkExplanationId (CVExtraDocFiles{}) = CICVExtraDocFiles +checkExplanationId (CVMultiLib{}) = CICVMultiLib +checkExplanationId (CVReexported{}) = CICVReexported +checkExplanationId (CVMixins{}) = CICVMixins +checkExplanationId (CVExtraFrameworkDirs{}) = CICVExtraFrameworkDirs +checkExplanationId (CVDefaultExtensions{}) = CICVDefaultExtensions +checkExplanationId (CVExtensionsDeprecated{}) = CICVExtensionsDeprecated +checkExplanationId (CVSources{}) = CICVSources +checkExplanationId (CVExtraDynamic{}) = CICVExtraDynamic +checkExplanationId (CVVirtualModules{}) = CICVVirtualModules +checkExplanationId (CVSourceRepository{}) = CICVSourceRepository +checkExplanationId (CVExtensions{}) = CICVExtensions +checkExplanationId (CVCustomSetup{}) = CICVCustomSetup +checkExplanationId (CVExpliticDepsCustomSetup{}) = CICVExpliticDepsCustomSetup +checkExplanationId (CVAutogenPaths{}) = CICVAutogenPaths +checkExplanationId (CVAutogenPackageInfo{}) = CICVAutogenPackageInfo +checkExplanationId (GlobNoMatch{}) = CIGlobNoMatch +checkExplanationId (GlobExactMatch{}) = CIGlobExactMatch +checkExplanationId (GlobNoDir{}) = CIGlobNoDir +checkExplanationId (UnknownOS{}) = CIUnknownOS +checkExplanationId (UnknownArch{}) = CIUnknownArch +checkExplanationId (UnknownCompiler{}) = CIUnknownCompiler +checkExplanationId (BaseNoUpperBounds{}) = CIBaseNoUpperBounds +checkExplanationId (MissingUpperBounds{}) = CIMissingUpperBounds +checkExplanationId (SuspiciousFlagName{}) = CISuspiciousFlagName +checkExplanationId (DeclaredUsedFlags{}) = CIDeclaredUsedFlags +checkExplanationId (NonASCIICustomField{}) = CINonASCIICustomField +checkExplanationId (RebindableClashPaths{}) = CIRebindableClashPaths +checkExplanationId (RebindableClashPackageInfo{}) = CIRebindableClashPackageInfo +checkExplanationId (WErrorUnneeded{}) = CIWErrorUnneeded +checkExplanationId (JUnneeded{}) = CIJUnneeded +checkExplanationId (FDeferTypeErrorsUnneeded{}) = CIFDeferTypeErrorsUnneeded +checkExplanationId (DynamicUnneeded{}) = CIDynamicUnneeded +checkExplanationId (ProfilingUnneeded{}) = CIProfilingUnneeded +checkExplanationId (UpperBoundSetup{}) = CIUpperBoundSetup +checkExplanationId (DuplicateModule{}) = CIDuplicateModule +checkExplanationId (PotentialDupModule{}) = CIPotentialDupModule +checkExplanationId (BOMStart{}) = CIBOMStart +checkExplanationId (NotPackageName{}) = CINotPackageName +checkExplanationId (NoDesc{}) = CINoDesc +checkExplanationId (MultiDesc{}) = CIMultiDesc +checkExplanationId (UnknownFile{}) = CIUnknownFile +checkExplanationId (MissingSetupFile{}) = CIMissingSetupFile +checkExplanationId (MissingConfigureScript{}) = CIMissingConfigureScript +checkExplanationId (UnknownDirectory{}) = CIUnknownDirectory +checkExplanationId (MissingSourceControl{}) = CIMissingSourceControl +checkExplanationId (MissingExpectedDocFiles{}) = CIMissingExpectedDocFiles +checkExplanationId (WrongFieldForExpectedDocFiles{}) = CIWrongFieldForExpectedDocFiles + +type CheckExplanationIDString = String + +-- A one-word identifier for each CheckExplanation +-- +-- ☞ N.B: if you modify anything here, remeber to change the documentation +-- in @doc/cabal-commands.rst@! +ppCheckExplanationId :: CheckExplanationID -> CheckExplanationIDString +ppCheckExplanationId CIParseWarning = "parser-warning" +ppCheckExplanationId CINoNameField = "no-name-field" +ppCheckExplanationId CINoVersionField = "no-version-field" +ppCheckExplanationId CINoTarget = "no-target" +ppCheckExplanationId CIUnnamedInternal = "unnamed-internal-library" +ppCheckExplanationId CIDuplicateSections = "duplicate-sections" +ppCheckExplanationId CIIllegalLibraryName = "illegal-library-name" +ppCheckExplanationId CINoModulesExposed = "no-modules-exposed" +ppCheckExplanationId CISignaturesCabal2 = "signatures" +ppCheckExplanationId CIAutogenNotExposed = "autogen-not-exposed" +ppCheckExplanationId CIAutogenIncludesNotIncluded = "autogen-not-included" +ppCheckExplanationId CINoMainIs = "no-main-is" +ppCheckExplanationId CINoHsLhsMain = "unknown-extension-main" +ppCheckExplanationId CIMainCCabal1_18 = "c-like-main" +ppCheckExplanationId CIAutogenNoOther = "autogen-other-modules" +ppCheckExplanationId CIAutogenIncludesNotIncludedExe = "autogen-exe" +ppCheckExplanationId CITestsuiteTypeNotKnown = "unknown-testsuite-type" +ppCheckExplanationId CITestsuiteNotSupported = "unsupported-testsuite" +ppCheckExplanationId CIBenchmarkTypeNotKnown = "unknown-bench" +ppCheckExplanationId CIBenchmarkNotSupported = "unsupported-bench" +ppCheckExplanationId CINoHsLhsMainBench = "bench-unknown-extension" +ppCheckExplanationId CIInvalidNameWin = "invalid-name-win" +ppCheckExplanationId CIZPrefix = "reserved-z-prefix" +ppCheckExplanationId CINoBuildType = "no-build-type" +ppCheckExplanationId CINoCustomSetup = "undeclared-custom-setup" +ppCheckExplanationId CIUnknownCompilers = "unknown-compiler-tested" +ppCheckExplanationId CIUnknownLanguages = "unknown-languages" +ppCheckExplanationId CIUnknownExtensions = "unknown-extension" +ppCheckExplanationId CILanguagesAsExtension = "languages-as-extensions" +ppCheckExplanationId CIDeprecatedExtensions = "deprecated-extensions" +ppCheckExplanationId CIMissingFieldCategory = "no-category" +ppCheckExplanationId CIMissingFieldMaintainer = "no-maintainer" +ppCheckExplanationId CIMissingFieldSynopsis = "no-synopsis" +ppCheckExplanationId CIMissingFieldDescription = "no-description" +ppCheckExplanationId CIMissingFieldSynOrDesc = "no-syn-desc" +ppCheckExplanationId CISynopsisTooLong = "long-synopsis" +ppCheckExplanationId CIShortDesc = "short-description" +ppCheckExplanationId CIInvalidTestWith = "invalid-range-tested" +ppCheckExplanationId CIImpossibleInternalDep = "impossible-dep" +ppCheckExplanationId CIImpossibleInternalExe = "impossible-dep-exe" +ppCheckExplanationId CIMissingInternalExe = "no-internal-exe" +ppCheckExplanationId CINONELicense = "license-none" +ppCheckExplanationId CINoLicense = "no-license" +ppCheckExplanationId CIAllRightsReservedLicense = "all-rights-reserved" +ppCheckExplanationId CILicenseMessParse = "license-parse" +ppCheckExplanationId CIUnrecognisedLicense = "unknown-license" +ppCheckExplanationId CIUncommonBSD4 = "bsd4-license" +ppCheckExplanationId CIUnknownLicenseVersion = "unknown-license-version" +ppCheckExplanationId CINoLicenseFile = "no-license-file" +ppCheckExplanationId CIUnrecognisedSourceRepo = "unrecognised-repo-type" +ppCheckExplanationId CIMissingType = "repo-no-type" +ppCheckExplanationId CIMissingLocation = "repo-no-location" +ppCheckExplanationId CIMissingModule = "repo-no-module" +ppCheckExplanationId CIMissingTag = "repo-no-tag" +ppCheckExplanationId CISubdirRelPath = "repo-relative-dir" +ppCheckExplanationId CISubdirGoodRelPath = "repo-malformed-subdir" +ppCheckExplanationId CIOptFasm = "option-fasm" +ppCheckExplanationId CIOptHpc = "option-fhpc" +ppCheckExplanationId CIOptProf = "option-prof" +ppCheckExplanationId CIOptO = "option-o" +ppCheckExplanationId CIOptHide = "option-hide-package" +ppCheckExplanationId CIOptMake = "option-make" +ppCheckExplanationId CIOptONot = "option-optimize" +ppCheckExplanationId CIOptOOne = "option-o1" +ppCheckExplanationId CIOptOTwo = "option-o2" +ppCheckExplanationId CIOptSplitSections = "option-split-section" +ppCheckExplanationId CIOptSplitObjs = "option-split-objs" +ppCheckExplanationId CIOptWls = "option-optl-wl" +ppCheckExplanationId CIOptExts = "use-extension" +ppCheckExplanationId CIOptRts = "option-rtsopts" +ppCheckExplanationId CIOptWithRts = "option-with-rtsopts" +ppCheckExplanationId CICOptONumber = "option-opt-c" +ppCheckExplanationId CICOptCPP = "cpp-options" +ppCheckExplanationId CIOptAlternatives = "misplaced-c-opt" +ppCheckExplanationId CIRelativeOutside = "relative-path-outside" +ppCheckExplanationId CIAbsolutePath = "absolute-path" +ppCheckExplanationId CIBadRelativePath = "malformed-relative-path" +ppCheckExplanationId CIDistPoint = "unreliable-dist-path" +ppCheckExplanationId CIGlobSyntaxError = "glob-syntax-error" +ppCheckExplanationId CIRecursiveGlobInRoot = "recursive-glob" +ppCheckExplanationId CIInvalidOnWin = "invalid-path-win" +ppCheckExplanationId CIFilePathTooLong = "long-path" +ppCheckExplanationId CIFilePathNameTooLong = "long-name" +ppCheckExplanationId CIFilePathSplitTooLong = "name-not-portable" +ppCheckExplanationId CIFilePathEmpty = "empty-path" +ppCheckExplanationId CICVTestSuite = "test-cabal-ver" +ppCheckExplanationId CICVDefaultLanguage = "default-language" +ppCheckExplanationId CICVDefaultLanguageComponent = "no-default-language" +ppCheckExplanationId CICVExtraDocFiles = "extra-doc-files" +ppCheckExplanationId CICVMultiLib = "multilib" +ppCheckExplanationId CICVReexported = "reexported-modules" +ppCheckExplanationId CICVMixins = "mixins" +ppCheckExplanationId CICVExtraFrameworkDirs = "extra-framework-dirs" +ppCheckExplanationId CICVDefaultExtensions = "default-extensions" +ppCheckExplanationId CICVExtensionsDeprecated = "extensions-field" +ppCheckExplanationId CICVSources = "unsupported-sources" +ppCheckExplanationId CICVExtraDynamic = "extra-dynamic" +ppCheckExplanationId CICVVirtualModules = "virtual-modules" +ppCheckExplanationId CICVSourceRepository = "source-repository" +ppCheckExplanationId CICVExtensions = "incompatible-extension" +ppCheckExplanationId CICVCustomSetup = "no-setup-depends" +ppCheckExplanationId CICVExpliticDepsCustomSetup = "dependencies-setup" +ppCheckExplanationId CICVAutogenPaths = "no-autogen-paths" +ppCheckExplanationId CICVAutogenPackageInfo = "no-autogen-pinfo" +ppCheckExplanationId CIGlobNoMatch = "no-glob-match" +ppCheckExplanationId CIGlobExactMatch = "glob-no-extension" +ppCheckExplanationId CIGlobNoDir = "glob-missing-dir" +ppCheckExplanationId CIUnknownOS = "unknown-os" +ppCheckExplanationId CIUnknownArch = "unknown-arch" +ppCheckExplanationId CIUnknownCompiler = "unknown-compiler" +ppCheckExplanationId CIBaseNoUpperBounds = "missing-bounds-important" +ppCheckExplanationId CIMissingUpperBounds = "missing-upper-bounds" +ppCheckExplanationId CISuspiciousFlagName = "suspicious-flag" +ppCheckExplanationId CIDeclaredUsedFlags = "unused-flag" +ppCheckExplanationId CINonASCIICustomField = "non-ascii" +ppCheckExplanationId CIRebindableClashPaths = "rebindable-clash-paths" +ppCheckExplanationId CIRebindableClashPackageInfo = "rebindable-clash-info" +ppCheckExplanationId CIWErrorUnneeded = "werror" +ppCheckExplanationId CIJUnneeded = "unneeded-j" +ppCheckExplanationId CIFDeferTypeErrorsUnneeded = "fdefer-type-errors" +ppCheckExplanationId CIDynamicUnneeded = "debug-flag" +ppCheckExplanationId CIProfilingUnneeded = "fprof-flag" +ppCheckExplanationId CIUpperBoundSetup = "missing-bounds-setup" +ppCheckExplanationId CIDuplicateModule = "duplicate-modules" +ppCheckExplanationId CIPotentialDupModule = "maybe-duplicate-modules" +ppCheckExplanationId CIBOMStart = "bom" +ppCheckExplanationId CINotPackageName = "name-no-match" +ppCheckExplanationId CINoDesc = "no-cabal-file" +ppCheckExplanationId CIMultiDesc = "multiple-cabal-file" +ppCheckExplanationId CIUnknownFile = "unknown-file" +ppCheckExplanationId CIMissingSetupFile = "missing-setup" +ppCheckExplanationId CIMissingConfigureScript = "missing-conf-script" +ppCheckExplanationId CIUnknownDirectory = "unknown-directory" +ppCheckExplanationId CIMissingSourceControl = "no-repository" +ppCheckExplanationId CIMissingExpectedDocFiles = "no-docs" +ppCheckExplanationId CIWrongFieldForExpectedDocFiles = "doc-place" + +-- String: the unrecognised 'CheckExplanationIDString' itself. +readExplanationID + :: CheckExplanationIDString + -> Either String CheckExplanationID +readExplanationID s = maybe (Left s) Right (lookup s idsDict) + where + idsDict :: [(CheckExplanationIDString, CheckExplanationID)] + idsDict = map (\i -> (ppCheckExplanationId i, i)) [minBound .. maxBound] + -- | Which stanza does `CheckExplanation` refer to? data CEType = CETLibrary LibraryName @@ -286,23 +752,6 @@ ppCET cet = case cet of qn :: UnqualComponentName -> String qn wn = (" " ++) . quote . prettyShow $ wn --- | Which field does `CheckExplanation` refer to? -data CEField - = CEFCategory - | CEFMaintainer - | CEFSynopsis - | CEFDescription - | CEFSynOrDesc - deriving (Eq, Ord, Show) - --- | Pretty printing `CEField`. -ppCEField :: CEField -> String -ppCEField CEFCategory = "category" -ppCEField CEFMaintainer = "maintainer" -ppCEField CEFSynopsis = "synopsis" -ppCEField CEFDescription = "description" -ppCEField CEFSynOrDesc = "synopsis' or 'description" - -- | Which language are we referring to in our warning message? data WarnLang = LangC | LangCPlusPlus deriving (Eq, Ord, Show) @@ -431,8 +880,11 @@ ppExplanation (DeprecatedExtensions ourDeprecatedExtensions) = ++ "'." | (ext, Just replacement) <- ourDeprecatedExtensions ] -ppExplanation (MissingField cef) = - "No '" ++ ppCEField cef ++ "' field." +ppExplanation MissingFieldCategory = "No 'category' field." +ppExplanation MissingFieldMaintainer = "No 'maintainer' field." +ppExplanation MissingFieldSynopsis = "No 'synopsis' field." +ppExplanation MissingFieldDescription = "No 'description' field." +ppExplanation MissingFieldSynOrDesc = "No 'synopsis' or 'description' field." ppExplanation SynopsisTooLong = "The 'synopsis' field is rather long (max 80 chars is recommended)." ppExplanation ShortDesc = diff --git a/cabal-install/src/Distribution/Client/Check.hs b/cabal-install/src/Distribution/Client/Check.hs index bfcea3f74f3..91fd6c7b448 100644 --- a/cabal-install/src/Distribution/Client/Check.hs +++ b/cabal-install/src/Distribution/Client/Check.hs @@ -59,14 +59,17 @@ readGenericPackageDescriptionCheck verbosity fpath = do -- is fit to upload to Hackage, @False@ otherwise. -- Note: must be called with the CWD set to the directory containing -- the '.cabal' file. -check :: Verbosity -> IO Bool -check verbosity = do +check :: Verbosity -> [CheckExplanationIDString] -> IO Bool +check verbosity ignores = do pdfile <- defaultPackageDesc verbosity (ws, ppd) <- readGenericPackageDescriptionCheck verbosity pdfile -- convert parse warnings into PackageChecks let ws' = map (wrapParseWarning pdfile) ws ioChecks <- checkPackageFilesGPD verbosity ppd "." - let packageChecks = ioChecks ++ checkPackage ppd ++ ws' + let packageChecksPrim = ioChecks ++ checkPackage ppd ++ ws' + (packageChecks, unrecs) = filterPackageChecksByIdString packageChecksPrim ignores + + CM.mapM_ (\s -> warn verbosity ("Unrecognised ignore \"" ++ s ++ "\"")) unrecs CM.mapM_ (outputGroupCheck verbosity) (groupChecks packageChecks) diff --git a/cabal-install/src/Distribution/Client/Main.hs b/cabal-install/src/Distribution/Client/Main.hs index dc196a66864..d7cf0ea49b4 100644 --- a/cabal-install/src/Distribution/Client/Main.hs +++ b/cabal-install/src/Distribution/Client/Main.hs @@ -23,6 +23,7 @@ module Distribution.Client.Main (main) where import Distribution.Client.Setup ( ActAsSetupFlags (..) , BuildFlags (..) + , CheckFlags (..) , ConfigExFlags (..) , ConfigFlags (..) , FetchFlags (..) @@ -1225,13 +1226,14 @@ uploadAction uploadFlags extraArgs globalFlags = do pkg <- fmap LBI.localPkgDescr (getPersistBuildConfig distPref) return $ distPref display (packageId pkg) ++ "-docs" <.> "tar.gz" -checkAction :: Flag Verbosity -> [String] -> Action -checkAction verbosityFlag extraArgs _globalFlags = do - let verbosity = fromFlag verbosityFlag +checkAction :: CheckFlags -> [String] -> Action +checkAction checkFlags extraArgs _globalFlags = do + let verbosityFlag = checkVerbosity checkFlags + verbosity = fromFlag verbosityFlag unless (null extraArgs) $ dieWithException verbosity $ CheckAction extraArgs - allOk <- Check.check (fromFlag verbosityFlag) + allOk <- Check.check (fromFlag verbosityFlag) (checkIgnore checkFlags) unless allOk exitFailure formatAction :: Flag Verbosity -> [String] -> Action diff --git a/cabal-install/src/Distribution/Client/Setup.hs b/cabal-install/src/Distribution/Client/Setup.hs index e752b573aad..c91e3739445 100644 --- a/cabal-install/src/Distribution/Client/Setup.hs +++ b/cabal-install/src/Distribution/Client/Setup.hs @@ -66,6 +66,7 @@ module Distribution.Client.Setup , unpackCommand , GetFlags (..) , checkCommand + , CheckFlags (..) , formatCommand , uploadCommand , UploadFlags (..) @@ -146,6 +147,7 @@ import Distribution.PackageDescription , LibraryName (..) , RepoKind (..) ) +import Distribution.PackageDescription.Check (CheckExplanationIDString) import Distribution.Parsec ( parsecCommaList ) @@ -1535,6 +1537,55 @@ genBoundsCommand = ] } +-- ------------------------------------------------------------ +-- Check command +-- ------------------------------------------------------------ + +data CheckFlags = CheckFlags + { checkVerbosity :: Flag Verbosity + , checkIgnore :: [CheckExplanationIDString] + } + deriving (Show, Generic, Typeable) + +defaultCheckFlags :: CheckFlags +defaultCheckFlags = + CheckFlags + { checkVerbosity = Flag normal + , checkIgnore = [] + } + +checkCommand :: CommandUI CheckFlags +checkCommand = + CommandUI + { commandName = "check" + , commandSynopsis = "Check the package for common mistakes." + , commandDescription = Just $ \_ -> + wrapText $ + "Expects a .cabal package file in the current directory.\n" + ++ "\n" + ++ "The checks correspond to the requirements to packages on Hackage. " + ++ "If no errors and warnings are reported, Hackage will accept this " + ++ "package.\n\n" + , commandNotes = Nothing + , commandUsage = usageFlags "check" + , commandDefaultFlags = defaultCheckFlags + , commandOptions = checkOptions' + } + +checkOptions' :: ShowOrParseArgs -> [OptionField CheckFlags] +checkOptions' _showOrParseArgs = + [ optionVerbosity + checkVerbosity + (\v flags -> flags{checkVerbosity = v}) + , option + ['i'] + ["ignore"] + "ignore a specific warning (e.g. --ignore=missing-upper-bounds)" + checkIgnore + (\v c -> c{checkIgnore = v ++ checkIgnore c}) + (reqArg' "WARNING" (: []) (const [])) + ] + -- ------------------------------------------------------------ -- * Update command @@ -1567,25 +1618,6 @@ cleanCommand = "Usage: " ++ pname ++ " v1-clean [FLAGS]\n" } -checkCommand :: CommandUI (Flag Verbosity) -checkCommand = - CommandUI - { commandName = "check" - , commandSynopsis = "Check the package for common mistakes." - , commandDescription = Just $ \_ -> - wrapText $ - "Expects a .cabal package file in the current directory.\n" - ++ "\n" - ++ "Some checks correspond to the requirements to packages on Hackage. " - ++ "If no `Error` is reported, Hackage should accept the " - ++ "package. If errors are present, `check` exits with 1 and Hackage " - ++ "will refuse the package.\n" - , commandNotes = Nothing - , commandUsage = usageFlags "check" - , commandDefaultFlags = toFlag normal - , commandOptions = \_ -> [optionVerbosity id const] - } - formatCommand :: CommandUI (Flag Verbosity) formatCommand = CommandUI diff --git a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out index dd76b493185..3cb109d47b6 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out +++ b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.cabal.out @@ -1,22 +1,22 @@ # Setup configure Configuring AutogenModules-0.1... Error: [Cabal-5559] -An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'. +[autogen-not-exposed] An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'. -On executable 'Exe' an 'autogen-module' is not on 'other-modules' +[autogen-other-modules] On executable 'Exe' an 'autogen-module' is not on 'other-modules' -On test suite 'Test' an 'autogen-module' is not on 'other-modules' +[autogen-other-modules] On test suite 'Test' an 'autogen-module' is not on 'other-modules' -On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' +[autogen-other-modules] On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' # Setup sdist Distribution quality errors: -An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'. -On executable 'Exe' an 'autogen-module' is not on 'other-modules' -On test suite 'Test' an 'autogen-module' is not on 'other-modules' -On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' -Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. -Packages using 'cabal-version: 2.0' and the autogenerated module PackageInfo_* must include it in 'autogen-modules' as well as 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. -The filename './my.cabal' does not match package name (expected: 'AutogenModules.cabal') +[autogen-not-exposed] An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'. +[autogen-other-modules] On executable 'Exe' an 'autogen-module' is not on 'other-modules' +[autogen-other-modules] On test suite 'Test' an 'autogen-module' is not on 'other-modules' +[autogen-other-modules] On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' +[no-autogen-paths] Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +[no-autogen-pinfo] Packages using 'cabal-version: 2.0' and the autogenerated module PackageInfo_* must include it in 'autogen-modules' as well as 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +[name-no-match] The filename './my.cabal' does not match package name (expected: 'AutogenModules.cabal') Note: the public hackage server would reject this package. Building source dist for AutogenModules-0.1... Error: [Cabal-6421] diff --git a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out index dd76b493185..3cb109d47b6 100644 --- a/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out +++ b/cabal-testsuite/PackageTests/AutogenModules/Package/setup.out @@ -1,22 +1,22 @@ # Setup configure Configuring AutogenModules-0.1... Error: [Cabal-5559] -An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'. +[autogen-not-exposed] An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'. -On executable 'Exe' an 'autogen-module' is not on 'other-modules' +[autogen-other-modules] On executable 'Exe' an 'autogen-module' is not on 'other-modules' -On test suite 'Test' an 'autogen-module' is not on 'other-modules' +[autogen-other-modules] On test suite 'Test' an 'autogen-module' is not on 'other-modules' -On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' +[autogen-other-modules] On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' # Setup sdist Distribution quality errors: -An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'. -On executable 'Exe' an 'autogen-module' is not on 'other-modules' -On test suite 'Test' an 'autogen-module' is not on 'other-modules' -On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' -Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. -Packages using 'cabal-version: 2.0' and the autogenerated module PackageInfo_* must include it in 'autogen-modules' as well as 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. -The filename './my.cabal' does not match package name (expected: 'AutogenModules.cabal') +[autogen-not-exposed] An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'. +[autogen-other-modules] On executable 'Exe' an 'autogen-module' is not on 'other-modules' +[autogen-other-modules] On test suite 'Test' an 'autogen-module' is not on 'other-modules' +[autogen-other-modules] On benchmark 'Bench' an 'autogen-module' is not on 'other-modules' +[no-autogen-paths] Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +[no-autogen-pinfo] Packages using 'cabal-version: 2.0' and the autogenerated module PackageInfo_* must include it in 'autogen-modules' as well as 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +[name-no-match] The filename './my.cabal' does not match package name (expected: 'AutogenModules.cabal') Note: the public hackage server would reject this package. Building source dist for AutogenModules-0.1... Error: [Cabal-6421] diff --git a/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.cabal.out b/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.cabal.out index 75bc0f494a7..38c474264aa 100644 --- a/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.cabal.out +++ b/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.cabal.out @@ -1,4 +1,4 @@ # Setup configure Configuring Reexport2-1.0... Error: [Cabal-5559] -Duplicate modules in library: Asdf +[duplicate-modules] Duplicate modules in library: Asdf diff --git a/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.out b/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.out index 75bc0f494a7..38c474264aa 100644 --- a/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.out +++ b/cabal-testsuite/PackageTests/Backpack/Reexport2/setup.out @@ -1,4 +1,4 @@ # Setup configure Configuring Reexport2-1.0... Error: [Cabal-5559] -Duplicate modules in library: Asdf +[duplicate-modules] Duplicate modules in library: Asdf diff --git a/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.cabal.out b/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.cabal.out index da5c074772e..3762dda7c78 100644 --- a/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.cabal.out +++ b/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.cabal.out @@ -1,4 +1,4 @@ # Setup configure Configuring build-tool-depends-missing-0.1.0.0... Error: [Cabal-5559] -The package depends on a missing internal executable: build-tool-depends-missing:hello-world +[no-internal-exe] The package depends on a missing internal executable: build-tool-depends-missing:hello-world diff --git a/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.out b/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.out index da5c074772e..3762dda7c78 100644 --- a/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.out +++ b/cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/setup.out @@ -1,4 +1,4 @@ # Setup configure Configuring build-tool-depends-missing-0.1.0.0... Error: [Cabal-5559] -The package depends on a missing internal executable: build-tool-depends-missing:hello-world +[no-internal-exe] The package depends on a missing internal executable: build-tool-depends-missing:hello-world diff --git a/cabal-testsuite/PackageTests/CCompilerOverride/setup.cabal.out b/cabal-testsuite/PackageTests/CCompilerOverride/setup.cabal.out index 456d6805574..21981fd9b76 100644 --- a/cabal-testsuite/PackageTests/CCompilerOverride/setup.cabal.out +++ b/cabal-testsuite/PackageTests/CCompilerOverride/setup.cabal.out @@ -1,4 +1,4 @@ # Setup configure Configuring my-0.1... -Warning: Instead of 'ghc-options: -DNOERROR4' use 'cpp-options: -DNOERROR4' +Warning: [misplaced-c-opt] Instead of 'ghc-options: -DNOERROR4' use 'cpp-options: -DNOERROR4' # Setup build diff --git a/cabal-testsuite/PackageTests/CCompilerOverride/setup.out b/cabal-testsuite/PackageTests/CCompilerOverride/setup.out index 456d6805574..21981fd9b76 100644 --- a/cabal-testsuite/PackageTests/CCompilerOverride/setup.out +++ b/cabal-testsuite/PackageTests/CCompilerOverride/setup.out @@ -1,4 +1,4 @@ # Setup configure Configuring my-0.1... -Warning: Instead of 'ghc-options: -DNOERROR4' use 'cpp-options: -DNOERROR4' +Warning: [misplaced-c-opt] Instead of 'ghc-options: -DNOERROR4' use 'cpp-options: -DNOERROR4' # Setup build diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CCOptionsExtraLibDirs/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CCOptionsExtraLibDirs/cabal.out index 11968358ef8..5ce08cca6be 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CCOptionsExtraLibDirs/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CCOptionsExtraLibDirs/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: Instead of 'cc-options: -Llibdir' use 'extra-lib-dirs: libdir' +Error: [misplaced-c-opt] Instead of 'cc-options: -Llibdir' use 'extra-lib-dirs: libdir' Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CCOptionsInclude/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CCOptionsInclude/cabal.out index 1886f29f4e4..fbbd3004595 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CCOptionsInclude/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CCOptionsInclude/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: Instead of 'cc-options: -Ifolder' use 'include-dirs: folder' +Error: [misplaced-c-opt] Instead of 'cc-options: -Ifolder' use 'include-dirs: folder' Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CppNotPortable/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CppNotPortable/cabal.out index 1d018c9105d..c98755ad49e 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CppNotPortable/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CppNotPortable/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: 'cpp-options: -Q' is not a portable C-preprocessor flag. +Error: [cpp-options] 'cpp-options: -Q' is not a portable C-preprocessor flag. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CxxOptionsExtraLibraries/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CxxOptionsExtraLibraries/cabal.out index 03a1fe95381..6f3593c9f38 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CxxOptionsExtraLibraries/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CxxOptionsExtraLibraries/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: Instead of 'cxx-options: -lgame' use 'extra-libraries: game' +Error: [misplaced-c-opt] Instead of 'cxx-options: -lgame' use 'extra-libraries: game' Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CxxOs/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CxxOs/cabal.out index 70b9e563c8c..6a1e83afa2b 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CxxOs/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/COptions/CxxOs/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: 'cxx-options: -O[n]' is generally not needed. When building with optimisations Cabal automatically adds '-O2' for C++ code. Setting it yourself interferes with the --disable-optimization flag. +Warning: [option-opt-c] 'cxx-options: -O[n]' is generally not needed. When building with optimisations Cabal automatically adds '-O2' for C++ code. Setting it yourself interferes with the --disable-optimization flag. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/AutoGenMods/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/AutoGenMods/cabal.out index 8d0799bafc4..6efbee4bb39 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/AutoGenMods/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/AutoGenMods/cabal.out @@ -1,5 +1,5 @@ # cabal check The following errors will cause portability problems on other environments: -Error: Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. -Error: Packages using 'cabal-version: 2.0' and the autogenerated module PackageInfo_* must include it in 'autogen-modules' as well as 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +Error: [no-autogen-paths] Packages using 'cabal-version: 2.0' and the autogenerated module Paths_* must include it also on the 'autogen-modules' field besides 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. +Error: [no-autogen-pinfo] Packages using 'cabal-version: 2.0' and the autogenerated module PackageInfo_* must include it in 'autogen-modules' as well as 'exposed-modules' and 'other-modules'. This specifies that the module does not come with the package and is generated on setup. Modules built with a custom Setup.hs script also go here to ensure that commands like sdist don't fail. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/CustomSetup/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/CustomSetup/cabal.out index a6136b65ff1..eed850f9a7f 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/CustomSetup/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/CustomSetup/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: From version 1.24 cabal supports specifying explicit dependencies for Custom setup scripts. Consider using 'cabal-version: 1.24' or higher and adding a 'custom-setup' section with a 'setup-depends' field that specifies the dependencies of the Setup.hs script itself. The 'setup-depends' field uses the same syntax as 'build-depends', so a simple example would be 'setup-depends: base, Cabal'. +Warning: [dependencies-setup] From version 1.24 cabal supports specifying explicit dependencies for Custom setup scripts. Consider using 'cabal-version: 1.24' or higher and adding a 'custom-setup' section with a 'setup-depends' field that specifies the dependencies of the Setup.hs script itself. The 'setup-depends' field uses the same syntax as 'build-depends', so a simple example would be 'setup-depends: base, Cabal'. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultExtension/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultExtension/cabal.out index 158f22274a1..6eab2b4cf95 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultExtension/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultExtension/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: pkg.cabal:14:3: The field "default-extensions" is available only since the Cabal specification version 1.10. This field will be ignored. +Warning: [parser-warning] pkg.cabal:14:3: The field "default-extensions" is available only since the Cabal specification version 1.10. This field will be ignored. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultLanguage/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultLanguage/cabal.out index e6777f75f91..1a27476d804 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultLanguage/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultLanguage/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: pkg.cabal:14:3: The field "default-language" is available only since the Cabal specification version 1.10. This field will be ignored. +Warning: [parser-warning] pkg.cabal:14:3: The field "default-language" is available only since the Cabal specification version 1.10. This field will be ignored. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultLanguageSpec/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultLanguageSpec/cabal.out index d15028bdca2..cc237924935 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultLanguageSpec/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/DefaultLanguageSpec/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: Packages using 'cabal-version: >= 1.10' and before 'cabal-version: 3.4' must specify the 'default-language' field for each component (e.g. Haskell98 or Haskell2010). If a component uses different languages in different modules then list the other ones in the 'other-languages' field. +Error: [no-default-language] Packages using 'cabal-version: >= 1.10' and before 'cabal-version: 3.4' must specify the 'default-language' field for each component (e.g. Haskell98 or Haskell2010). If a component uses different languages in different modules then list the other ones in the 'other-languages' field. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtensionBreak/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtensionBreak/cabal.out index e585e23095a..cbbc63dfeec 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtensionBreak/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtensionBreak/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: Unfortunately the language extensions 'MonoPatBinds' break the parser in earlier Cabal versions so you need to specify 'cabal-version: >= 1.4'. Alternatively if you require compatibility with earlier Cabal versions then you may be able to use an equivalent compiler-specific flag. +Error: [incompatible-extension] Unfortunately the language extensions 'MonoPatBinds' break the parser in earlier Cabal versions so you need to specify 'cabal-version: >= 1.4'. Alternatively if you require compatibility with earlier Cabal versions then you may be able to use an equivalent compiler-specific flag. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Extensions/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Extensions/cabal.out index 5d1206fb865..e81f62d757f 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Extensions/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Extensions/cabal.out @@ -1,6 +1,6 @@ # cabal check The following errors are likely to affect your build negatively: -Error: For packages using 'cabal-version: >= 1.10' the 'extensions' field is deprecated. The new 'default-extensions' field lists extensions that are used in all modules in the component, while the 'other-extensions' field lists extensions that are used in some modules, e.g. via the {-# LANGUAGE #-} pragma. +Error: [extensions-field] For packages using 'cabal-version: >= 1.10' the 'extensions' field is deprecated. The new 'default-extensions' field lists extensions that are used in all modules in the component, while the 'other-extensions' field lists extensions that are used in some modules, e.g. via the {-# LANGUAGE #-} pragma. These warnings will likely cause trouble when distributing the package: -Warning: pkg.cabal:14:3: The field "extensions" is deprecated in the Cabal specification version 1.12. Please use 'default-extensions' or 'other-extensions' fields. +Warning: [parser-warning] pkg.cabal:14:3: The field "extensions" is deprecated in the Cabal specification version 1.12. Please use 'default-extensions' or 'other-extensions' fields. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraDoc/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraDoc/cabal.out index e278c388c68..ed7c7b175d8 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraDoc/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraDoc/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: To use the 'extra-doc-files' field the package needs to specify 'cabal-version: 1.18' or higher. +Error: [extra-doc-files] To use the 'extra-doc-files' field the package needs to specify 'cabal-version: 1.18' or higher. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraDynamicLibraryFlavour/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraDynamicLibraryFlavour/cabal.out index 8653d8052b7..1134c50f5ee 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraDynamicLibraryFlavour/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraDynamicLibraryFlavour/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: pkg.cabal:14:3: The field "extra-dynamic-library-flavours" is available only since the Cabal specification version 3.0. This field will be ignored. +Warning: [parser-warning] pkg.cabal:14:3: The field "extra-dynamic-library-flavours" is available only since the Cabal specification version 3.0. This field will be ignored. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraFrameworkDirs/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraFrameworkDirs/cabal.out index 4787a8d3906..9d7702781fd 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraFrameworkDirs/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/ExtraFrameworkDirs/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: To use the 'extra-framework-dirs' field the package needs to specify 'cabal-version: 1.24' or higher. +Warning: [extra-framework-dirs] To use the 'extra-framework-dirs' field the package needs to specify 'cabal-version: 1.24' or higher. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Mixins/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Mixins/cabal.out index b3cdf60b8fb..35c4a9ac71b 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Mixins/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Mixins/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: pkg.cabal:15:3: The field "mixins" is available only since the Cabal specification version 2.0. This field will be ignored. +Warning: [parser-warning] pkg.cabal:15:3: The field "mixins" is available only since the Cabal specification version 2.0. This field will be ignored. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/MultiLibs/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/MultiLibs/cabal.out index 781eb79249c..ff4813b9d61 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/MultiLibs/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/MultiLibs/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: To use multiple 'library' sections or a named library section the package needs to specify at least 'cabal-version: 2.0'. +Error: [multilib] To use multiple 'library' sections or a named library section the package needs to specify at least 'cabal-version: 2.0'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Reexported/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Reexported/cabal.out index c8744b4247d..1d41c7f1668 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Reexported/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Reexported/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: To use the 'reexported-module' field the package needs to specify 'cabal-version: 1.22' or higher. +Error: [reexported-modules] To use the 'reexported-module' field the package needs to specify 'cabal-version: 1.22' or higher. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/SourceRepository/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/SourceRepository/cabal.out index 3bbf94940a2..ade484c6e98 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/SourceRepository/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/SourceRepository/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The 'source-repository' section is new in Cabal 1.6. Unfortunately it messes up the parser in earlier Cabal versions so you need to specify 'cabal-version: >= 1.6'. +Error: [source-repository] The 'source-repository' section is new in Cabal 1.6. Unfortunately it messes up the parser in earlier Cabal versions so you need to specify 'cabal-version: >= 1.6'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Sources/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Sources/cabal.out index 22b9a8325d2..731cf4b5b92 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Sources/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Sources/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: pkg.cabal:14:3: The field "cmm-sources" is available only since the Cabal specification version 3.0. This field will be ignored. +Warning: [parser-warning] pkg.cabal:14:3: The field "cmm-sources" is available only since the Cabal specification version 3.0. This field will be ignored. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Testsuite1.8/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Testsuite1.8/cabal.out index e11f45f88a1..6ec9ae7a2ff 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Testsuite1.8/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/Testsuite1.8/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The 'test-suite' section is new in Cabal 1.10. Unfortunately it messes up the parser in older Cabal versions so you must specify at least 'cabal-version: >= 1.8', but note that only Cabal 1.10 and later can actually run such test suites. +Error: [test-cabal-ver] The 'test-suite' section is new in Cabal 1.10. Unfortunately it messes up the parser in older Cabal versions so you must specify at least 'cabal-version: >= 1.8', but note that only Cabal 1.10 and later can actually run such test suites. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/VirtualModules/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/VirtualModules/cabal.out index 0d294b7fa40..8b58c8122f0 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/VirtualModules/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/CabalVersion/VirtualModules/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: pkg.cabal:14:3: The field "virtual-modules" is available only since the Cabal specification version 2.2. This field will be ignored. +Warning: [parser-warning] pkg.cabal:14:3: The field "virtual-modules" is available only since the Cabal specification version 2.2. This field will be ignored. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/DeprecatedExtension/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/DeprecatedExtension/cabal.out index 312b6054a67..4b84de207fe 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/DeprecatedExtension/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/DeprecatedExtension/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: Deprecated extensions: 'RecordPuns'. Instead of 'RecordPuns' use 'NamedFieldPuns'. +Warning: [deprecated-extensions] Deprecated extensions: 'RecordPuns'. Instead of 'RecordPuns' use 'NamedFieldPuns'. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/ImpossibleVersionRangeLib/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/ImpossibleVersionRangeLib/cabal.out index bfff695159e..c037b09c0f5 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/ImpossibleVersionRangeLib/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/ImpossibleVersionRangeLib/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: The package has an impossible version range for a dependency on an internal library: pkg:internal >1.0 && <2.0. This version range does not include the current package, and must be removed as the current package's library will always be used. +Error: [impossible-dep] The package has an impossible version range for a dependency on an internal library: pkg:internal >1.0 && <2.0. This version range does not include the current package, and must be removed as the current package's library will always be used. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/InvalidTestedWithRange/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/InvalidTestedWithRange/cabal.out index 42ba46392e1..10302be399d 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/InvalidTestedWithRange/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/InvalidTestedWithRange/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: Invalid 'tested-with' version range: ghc ==6.10 && ==7.1. To indicate that you have tested a package with multiple different versions of the same compiler use multiple entries, for example 'tested-with: GHC==6.10.4, GHC==6.12.3' and not 'tested-with: GHC==6.10.4 && ==6.12.3'. +Error: [invalid-range-tested] Invalid 'tested-with' version range: ghc ==6.10 && ==7.1. To indicate that you have tested a package with multiple different versions of the same compiler use multiple entries, for example 'tested-with: GHC==6.10.4, GHC==6.12.3' and not 'tested-with: GHC==6.10.4 && ==6.12.3'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/LanguageAsExtension/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/LanguageAsExtension/cabal.out index b9fc6aad35b..abe57ea0117 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/LanguageAsExtension/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/LanguageAsExtension/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: Languages listed as extensions: Haskell98. Languages must be specified in either the 'default-language' or the 'other-languages' field. +Error: [languages-as-extensions] Languages listed as extensions: Haskell98. Languages must be specified in either the 'default-language' or the 'other-languages' field. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoBuildTypeSpecified/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoBuildTypeSpecified/cabal.out index db55a3ca9d2..a8f63c2e114 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoBuildTypeSpecified/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoBuildTypeSpecified/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: No 'build-type' specified. If you do not need a custom Setup.hs or ./configure script then use 'build-type: Simple'. +Error: [no-build-type] No 'build-type' specified. If you do not need a custom Setup.hs or ./configure script then use 'build-type: Simple'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoCategory/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoCategory/cabal.out index 212ddc826c1..b458ed6d1b6 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoCategory/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoCategory/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: No 'category' field. +Warning: [no-category] No 'category' field. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoCustom/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoCustom/cabal.out index 26779e22ed2..8d4059d241e 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoCustom/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoCustom/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: Ignoring the 'custom-setup' section because the 'build-type' is not 'Custom'. Use 'build-type: Custom' if you need to use a custom Setup.hs script. +Error: [undeclared-custom-setup] Ignoring the 'custom-setup' section because the 'build-type' is not 'Custom'. Use 'build-type: Custom' if you need to use a custom Setup.hs script. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoDescription/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoDescription/cabal.out index 3754003ebd5..90308bb925e 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoDescription/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoDescription/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: No 'description' field. +Warning: [no-description] No 'description' field. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoMaintainer/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoMaintainer/cabal.out index 18f1b2e50ae..42cc2c2f15f 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoMaintainer/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoMaintainer/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: No 'maintainer' field. +Warning: [no-maintainer] No 'maintainer' field. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoSynopsis/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoSynopsis/cabal.out index 7c5e82873a1..cbe4fb78ae3 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoSynopsis/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoSynopsis/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: No 'synopsis' field. +Warning: [no-synopsis] No 'synopsis' field. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoZPrefix/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoZPrefix/cabal.out index 61998a26253..927476c9569 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoZPrefix/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoZPrefix/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: Package names with the prefix 'z-' are reserved by Cabal and cannot be used. +Error: [reserved-z-prefix] Package names with the prefix 'z-' are reserved by Cabal and cannot be used. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/ShortDescription/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/ShortDescription/cabal.out index 6ab4a3c38b4..da4e609be7a 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/ShortDescription/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/ShortDescription/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: The 'description' field should be longer than the 'synopsis' field. It's useful to provide an informative 'description' to allow Haskell programmers who have never heard about your package to understand the purpose of your package. The 'description' field content is typically shown by tooling (e.g. 'cabal info', Haddock, Hackage) below the 'synopsis' which serves as a headline. Please refer to for more details. +Warning: [short-description] The 'description' field should be longer than the 'synopsis' field. It's useful to provide an informative 'description' to allow Haskell programmers who have never heard about your package to understand the purpose of your package. The 'description' field content is typically shown by tooling (e.g. 'cabal info', Haddock, Hackage) below the 'synopsis' which serves as a headline. Please refer to for more details. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownCompiler/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownCompiler/cabal.out index 2859433cf4d..a9ea6b85ef8 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownCompiler/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownCompiler/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: Unknown compiler 'figforth' in 'tested-with' field. +Error: [unknown-compiler-tested] Unknown compiler 'figforth' in 'tested-with' field. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownExtension/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownExtension/cabal.out index 7b44b7da37f..61d9f7e4fe0 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownExtension/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownExtension/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: Unknown extensions: ObliqueTypes +Error: [unknown-extension] Unknown extensions: ObliqueTypes Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownLanguage/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownLanguage/cabal.out index 38512b53c70..acc60085f69 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownLanguage/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/UnknownLanguage/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: Unknown languages: Haskell2030 +Error: [unknown-languages] Unknown languages: Haskell2030 Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCOptions/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCOptions/cabal.out index 1227df464c0..3ff40908e34 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCOptions/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCOptions/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: 'ghc-options: -fasm' is unnecessary and will not work on CPU architectures other than x86, x86-64, ppc or sparc. +Error: [option-fasm] 'ghc-options: -fasm' is unnecessary and will not work on CPU architectures other than x86, x86-64, ppc or sparc. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCProfOptions/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCProfOptions/cabal.out index eff6f0352a7..0c49fb8c1d6 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCProfOptions/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCProfOptions/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: 'ghc-prof-options: -o' is not needed. The output files are named automatically. +Error: [option-o] 'ghc-prof-options: -o' is not needed. The output files are named automatically. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCSharedOptions/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCSharedOptions/cabal.out index 996af558dce..44d0a6ecfd2 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCSharedOptions/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/GHCSharedOptions/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: Instead of 'ghc-shared-options: -fglasgow-exts' it is preferable to use the 'extensions' field. +Warning: [use-extension] Instead of 'ghc-shared-options: -fglasgow-exts' it is preferable to use the 'extensions' field. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagManual/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagManual/cabal.out index 54660ce787e..077d7e9e85c 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagManual/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagManual/cabal.out @@ -1,4 +1,3 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: 'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit and not just imposing longer compile times on your users. - +Warning: [option-o2] 'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit and not just imposing longer compile times on your users. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagOut/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagOut/cabal.out index 54660ce787e..077d7e9e85c 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagOut/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/GHCOptions/NoWarnFlagOut/cabal.out @@ -1,4 +1,3 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: 'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit and not just imposing longer compile times on your users. - +Warning: [option-o2] 'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit and not just imposing longer compile times on your users. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/Compatibility/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/Compatibility/cabal.out index e41ad1c8b5d..a5f9fe9b670 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/Compatibility/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/Compatibility/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: Unfortunately the license 'ISC' messes up the parser in earlier Cabal versions so you need to specify 'cabal-version: >= 1.4'. Alternatively if you require compatibility with earlier Cabal versions then use 'OtherLicense'. +Error: [license-parse] Unfortunately the license 'ISC' messes up the parser in earlier Cabal versions so you need to specify 'cabal-version: >= 1.4'. Alternatively if you require compatibility with earlier Cabal versions then use 'OtherLicense'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoFileSpecified/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoFileSpecified/cabal.out index a21a032fdc5..aba9738f1d5 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoFileSpecified/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoFileSpecified/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: A 'license-file' is not specified. +Warning: [no-license-file] A 'license-file' is not specified. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoLicense/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoLicense/cabal.out index b5b98a177f9..21fe34be8c0 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoLicense/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoLicense/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The 'license' field is missing or is NONE. +Error: [license-none] The 'license' field is missing or is NONE. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoneLicense/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoneLicense/cabal.out index b5b98a177f9..21fe34be8c0 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoneLicense/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/NoneLicense/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The 'license' field is missing or is NONE. +Error: [license-none] The 'license' field is missing or is NONE. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/SuspiciousLicense/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/SuspiciousLicense/cabal.out index 5c3e9dcfc94..890c548b3e7 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/SuspiciousLicense/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/SuspiciousLicense/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: Using 'license: BSD4' is almost always a misunderstanding. 'BSD4' refers to the old 4-clause BSD license with the advertising clause. 'BSD3' refers the new 3-clause BSD license. +Warning: [bsd4-license] Using 'license: BSD4' is almost always a misunderstanding. 'BSD4' refers to the old 4-clause BSD license with the advertising clause. 'BSD3' refers the new 3-clause BSD license. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/SuspiciousVersion/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/SuspiciousVersion/cabal.out index e42fa129f7b..262947562a1 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/SuspiciousVersion/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/SuspiciousVersion/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: 'license: GPL-5' is not a known version of that license. The known versions are 2, 3. If this is not a mistake and you think it should be a known version then please file a ticket. +Warning: [unknown-license-version] 'license: GPL-5' is not a known version of that license. The known versions are 2, 3. If this is not a mistake and you think it should be a known version then please file a ticket. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/UnknownLicence/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/UnknownLicence/cabal.out index f5cb98a415e..82915b6973c 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/UnknownLicence/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/UnknownLicence/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: 'license: Illiberal' is not a recognised license. The known licenses are: GPL, GPL-2, GPL-3, LGPL, LGPL-2.1, LGPL-3, AGPL, AGPL-3, BSD2, BSD3, MIT, ISC, MPL-2.0, Apache, Apache-2.0, PublicDomain, AllRightsReserved, OtherLicense +Error: [unknown-license] 'license: Illiberal' is not a recognised license. The known licenses are: GPL, GPL-2, GPL-3, LGPL, LGPL-2.1, LGPL-3, AGPL, AGPL-3, BSD2, BSD3, MIT, ISC, MPL-2.0, Apache, Apache-2.0, PublicDomain, AllRightsReserved, OtherLicense Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/WarnAllRightsReserved/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/WarnAllRightsReserved/cabal.out index a3bae9860eb..0dfd27c6aae 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/WarnAllRightsReserved/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/License/WarnAllRightsReserved/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: The 'license' is AllRightsReserved. Is that really what you want? +Warning: [all-rights-reserved] The 'license' is AllRightsReserved. Is that really what you want? diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/AbsolutePath/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/AbsolutePath/cabal.out index 23af99ec09a..8fa0a5d985b 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/AbsolutePath/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/AbsolutePath/cabal.out @@ -1,7 +1,7 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: In 'extra-source-files': the pattern '/home/user/file' does not match any files. +Warning: [no-glob-match] In 'extra-source-files': the pattern '/home/user/file' does not match any files. The following errors will cause portability problems on other environments: -Error: 'extra-source-files: /home/user/file' specifies an absolute path, but the 'extra-source-files' field must use relative paths. -Error: 'extra-source-files: /home/user/file' is not a good relative path: "posix absolute path" +Error: [absolute-path] 'extra-source-files: /home/user/file' specifies an absolute path, but the 'extra-source-files' field must use relative paths. +Error: [malformed-relative-path] 'extra-source-files: /home/user/file' is not a good relative path: "posix absolute path" Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/DistPoint/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/DistPoint/cabal.out index 477e1108ab3..da3b67b4433 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/DistPoint/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/DistPoint/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: 'ghc-options' path 'dist/file' points inside the 'dist' directory. This is not reliable because the location of this directory is configurable by the user (or package manager). In addition, the layout of the 'dist' directory is subject to change in future versions of Cabal. +Error: [unreliable-dist-path] 'ghc-options' path 'dist/file' points inside the 'dist' directory. This is not reliable because the location of this directory is configurable by the user (or package manager). In addition, the layout of the 'dist' directory is subject to change in future versions of Cabal. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.out index 55661e48010..93ecfd3c969 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/InvalidWin/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The path 'n?ul/*.a' is invalid on Windows, which would cause portability problems for this package. Windows file names cannot contain any of the characters ":*?<>|" and there a few reserved names including "aux", "nul", "con", "prn", "com1-9", "lpt1-9" and "clock$". +Error: [invalid-path-win] The path 'n?ul/*.a' is invalid on Windows, which would cause portability problems for this package. Windows file names cannot contain any of the characters ":*?<>|" and there a few reserved names including "aux", "nul", "con", "prn", "com1-9", "lpt1-9" and "clock$". Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RecursiveGlobInRoot/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RecursiveGlobInRoot/cabal.out index e4930d6a4b5..8da49655e16 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RecursiveGlobInRoot/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RecursiveGlobInRoot/cabal.out @@ -1,5 +1,5 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: In the 'data-files': glob '**/*.dat' starts at project root directory, this might include `.git/`, ``dist-newstyle/``, or other large directories! -Warning: In the 'extra-doc-files': glob '**/*.md' starts at project root directory, this might include `.git/`, ``dist-newstyle/``, or other large directories! -Warning: In the 'extra-source-files': glob '**/*.hs' starts at project root directory, this might include `.git/`, ``dist-newstyle/``, or other large directories! +Warning: [recursive-glob] In the 'data-files': glob '**/*.dat' starts at project root directory, this might include `.git/`, ``dist-newstyle/``, or other large directories! +Warning: [recursive-glob] In the 'extra-doc-files': glob '**/*.md' starts at project root directory, this might include `.git/`, ``dist-newstyle/``, or other large directories! +Warning: [recursive-glob] In the 'extra-source-files': glob '**/*.hs' starts at project root directory, this might include `.git/`, ``dist-newstyle/``, or other large directories! diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RelativeOutside/RelativeOutsideInner/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RelativeOutside/RelativeOutsideInner/cabal.out index 8cadbcb8dac..8ad6abfabfa 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RelativeOutside/RelativeOutsideInner/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RelativeOutside/RelativeOutsideInner/cabal.out @@ -1,6 +1,6 @@ # cabal check The following errors are likely to affect your build negatively: -Error: 'extra-source-files: ../outside' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'. +Error: [relative-path-outside] 'extra-source-files: ../outside' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'. The following errors will cause portability problems on other environments: -Error: 'extra-source-files: ../outside' is not a good relative path: "parent directory segment: .." +Error: [malformed-relative-path] 'extra-source-files: ../outside' is not a good relative path: "parent directory segment: .." Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOther/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOther/cabal.out index 94c22120311..d9f8024aff9 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOther/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOther/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'. +Error: [autogen-not-exposed] An 'autogen-module' is neither on 'exposed-modules' nor 'other-modules'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherBenchmark/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherBenchmark/cabal.out index a44b9f6880e..8df661d2d7c 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherBenchmark/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherBenchmark/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: On benchmark 'benchmark' an 'autogen-module' is not on 'other-modules' +Error: [autogen-other-modules] On benchmark 'benchmark' an 'autogen-module' is not on 'other-modules' Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherExe/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherExe/cabal.out index f31c3ad2803..6626c28605a 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherExe/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherExe/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: On executable 'exe' an 'autogen-module' is not on 'other-modules' +Error: [autogen-other-modules] On executable 'exe' an 'autogen-module' is not on 'other-modules' Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherTestsuite/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherTestsuite/cabal.out index f62322ba72b..708f8cb0d19 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherTestsuite/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenExposedOtherTestsuite/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: On test suite 'test' an 'autogen-module' is not on 'other-modules' +Error: [autogen-other-modules] On test suite 'test' an 'autogen-module' is not on 'other-modules' Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludes/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludes/cabal.out index 3ae07a9c509..986ba6008f8 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludes/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludes/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: An include in 'autogen-includes' is neither in 'includes' nor 'install-includes'. +Error: [autogen-not-included] An include in 'autogen-includes' is neither in 'includes' nor 'install-includes'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesBenchmark/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesBenchmark/cabal.out index a1b2bc17f2d..f96159eaed6 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesBenchmark/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesBenchmark/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: An include in 'autogen-includes' is not in 'includes'. +Error: [autogen-exe] An include in 'autogen-includes' is not in 'includes'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesExe/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesExe/cabal.out index a1b2bc17f2d..f96159eaed6 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesExe/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesExe/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: An include in 'autogen-includes' is not in 'includes'. +Error: [autogen-exe] An include in 'autogen-includes' is not in 'includes'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesTestsuite/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesTestsuite/cabal.out index a1b2bc17f2d..f96159eaed6 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesTestsuite/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/AutogenIncludesTestsuite/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: An include in 'autogen-includes' is not in 'includes'. +Error: [autogen-exe] An include in 'autogen-includes' is not in 'includes'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.out index 5e09174e51b..153c5f76ca9 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersion/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The package uses a C/C++/obj-C source file for the 'main-is' field. To use this feature you need to specify 'cabal-version: 1.18' or higher. +Error: [c-like-main] The package uses a C/C++/obj-C source file for the 'main-is' field. To use this feature you need to specify 'cabal-version: 1.18' or higher. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersionTestsuite/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersionTestsuite/cabal.out index 5e09174e51b..153c5f76ca9 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersionTestsuite/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/CMainIsVersionTestsuite/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The package uses a C/C++/obj-C source file for the 'main-is' field. To use this feature you need to specify 'cabal-version: 1.18' or higher. +Error: [c-like-main] The package uses a C/C++/obj-C source file for the 'main-is' field. To use this feature you need to specify 'cabal-version: 1.18' or higher. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIs/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIs/cabal.out index 6bc2ecc6449..a512bdbde70 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIs/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIs/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: The 'main-is' field must specify a '.hs' or '.lhs' file (even if it is generated by a preprocessor), or it may specify a C/C++/obj-C source file. +Error: [unknown-extension-main] The 'main-is' field must specify a '.hs' or '.lhs' file (even if it is generated by a preprocessor), or it may specify a C/C++/obj-C source file. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIsBenchmark/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIsBenchmark/cabal.out index 1eb6a2febe9..c118f5ca4b3 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIsBenchmark/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIsBenchmark/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: The 'main-is' field must specify a '.hs' or '.lhs' file (even if it is generated by a preprocessor). +Error: [bench-unknown-extension] The 'main-is' field must specify a '.hs' or '.lhs' file (even if it is generated by a preprocessor). Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIsTestsuite/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIsTestsuite/cabal.out index 6bc2ecc6449..a512bdbde70 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIsTestsuite/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/MalformedMainIsTestsuite/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: The 'main-is' field must specify a '.hs' or '.lhs' file (even if it is generated by a preprocessor), or it may specify a C/C++/obj-C source file. +Error: [unknown-extension-main] The 'main-is' field must specify a '.hs' or '.lhs' file (even if it is generated by a preprocessor), or it may specify a C/C++/obj-C source file. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoBody/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoBody/cabal.out index 8655087550d..ea20496c0bb 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoBody/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoBody/cabal.out @@ -1,6 +1,6 @@ # cabal check The package will not build sanely due to these errors: -Error: No executables, libraries, tests, or benchmarks found. Nothing to do. +Error: [no-target] No executables, libraries, tests, or benchmarks found. Nothing to do. These warnings will likely cause trouble when distributing the package: -Warning: pkg.cabal:0:0: A package using 'cabal-version: 2.2' must use section syntax. See the Cabal user guide for details. +Warning: [parser-warning] pkg.cabal:0:0: A package using 'cabal-version: 2.2' must use section syntax. See the Cabal user guide for details. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoDupNames/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoDupNames/cabal.out index fd288ec5fdd..b55258a3f28 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoDupNames/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoDupNames/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: Duplicate sections: dup. The name of every library, executable, test suite, and benchmark section in the package must be unique. +Error: [duplicate-sections] Duplicate sections: dup. The name of every library, executable, test suite, and benchmark section in the package must be unique. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoExposedModules/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoExposedModules/cabal.out index 3ae23450b99..7ece70213f9 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoExposedModules/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoExposedModules/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: library does not expose any modules +Warning: [no-modules-exposed] library does not expose any modules diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoInternalNameClash/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoInternalNameClash/cabal.out index 9366f5237f0..275672a9865 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoInternalNameClash/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoInternalNameClash/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: Illegal internal library name pkg. Internal libraries cannot have the same name as the package. Maybe you wanted a non-internal library? If so, rewrite the section stanza from 'library: 'pkg' to 'library'. +Error: [illegal-library-name] Illegal internal library name pkg. Internal libraries cannot have the same name as the package. Maybe you wanted a non-internal library? If so, rewrite the section stanza from 'library: 'pkg' to 'library'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoMainIs/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoMainIs/cabal.out index ba56af15c08..f1f7cfe863b 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoMainIs/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/NoMainIs/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: No 'main-is' field found for executable exe +Error: [no-main-is] No 'main-is' field found for executable exe Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/VersionSignatures/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/VersionSignatures/cabal.out index 2583cecb229..335e87962e3 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/VersionSignatures/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Sanity/VersionSignatures/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: pkg.cabal:17:3: The field "signatures" is available only since the Cabal specification version 2.0. This field will be ignored. +Warning: [parser-warning] pkg.cabal:17:3: The field "signatures" is available only since the Cabal specification version 2.0. This field will be ignored. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoGoodRelative/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoGoodRelative/cabal.out index 9d466d9b746..5cf561d9b47 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoGoodRelative/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoGoodRelative/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The 'subdir' field of a source-repository is not a good relative path: "empty path segment" +Error: [repo-malformed-subdir] The 'subdir' field of a source-repository is not a good relative path: "empty path segment" Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoLocation/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoLocation/cabal.out index 024e9692a50..1af7aa00f75 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoLocation/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoLocation/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The source-repository 'location' is a required field. +Error: [repo-no-location] The source-repository 'location' is a required field. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoModuleCVS/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoModuleCVS/cabal.out index a4ed5c844b5..25b389de331 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoModuleCVS/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoModuleCVS/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: For a CVS source-repository, the 'module' is a required field. +Error: [repo-no-module] For a CVS source-repository, the 'module' is a required field. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoType/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoType/cabal.out index 252f5fb7f8b..d5fedfd3a4d 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoType/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NoType/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The source-repository 'type' is a required field. +Error: [repo-no-type] The source-repository 'type' is a required field. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NonRecognisedRepo/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NonRecognisedRepo/cabal.out index 0bd66421809..614be86180e 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NonRecognisedRepo/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/NonRecognisedRepo/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: 'tail' is not a recognised kind of source-repository. The repo kind is usually 'head' or 'this' +Error: [unrecognised-repo-type] 'tail' is not a recognised kind of source-repository. The repo kind is usually 'head' or 'this' Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/SubdirRelative/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/SubdirRelative/cabal.out index 56b53170135..6c5e3f356c2 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/SubdirRelative/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/SubdirRelative/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The 'subdir' field of a source-repository must be a relative path. +Error: [repo-relative-dir] The 'subdir' field of a source-repository must be a relative path. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/ThisTag/cabal.out b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/ThisTag/cabal.out index 32bcf334cf5..b9185de3002 100644 --- a/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/ThisTag/cabal.out +++ b/cabal-testsuite/PackageTests/Check/ConfiguredPackage/SourceRepos/ThisTag/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: For the 'this' kind of source-repository, the 'tag' is a required field. It should specify the tag corresponding to this version or release of the package. +Error: [repo-no-tag] For the 'this' kind of source-repository, the 'tag' is a required field. It should specify the tag corresponding to this version or release of the package. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/DifferentGhcOptions/cabal.out b/cabal-testsuite/PackageTests/Check/DifferentGhcOptions/cabal.out index eb51a7165be..c8f48453a0c 100644 --- a/cabal-testsuite/PackageTests/Check/DifferentGhcOptions/cabal.out +++ b/cabal-testsuite/PackageTests/Check/DifferentGhcOptions/cabal.out @@ -1,8 +1,8 @@ # cabal check The following errors are likely to affect your build negatively: -Error: 'ghc-shared-options: -hide-package' is never needed. Cabal hides all packages. +Error: [option-hide-package] 'ghc-shared-options: -hide-package' is never needed. Cabal hides all packages. The following errors will cause portability problems on other environments: -Error: 'ghc-options: -fasm' is unnecessary and will not work on CPU architectures other than x86, x86-64, ppc or sparc. -Error: 'ghc-prof-options: -fhpc' is not necessary. Use the configure flag --enable-coverage instead. -Error: 'ghc-shared-options: -Werror' makes the package easy to break with future GHC versions because new GHC versions often add new warnings. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. +Error: [option-fasm] 'ghc-options: -fasm' is unnecessary and will not work on CPU architectures other than x86, x86-64, ppc or sparc. +Error: [option-fhpc] 'ghc-prof-options: -fhpc' is not necessary. Use the configure flag --enable-coverage instead. +Error: [werror] 'ghc-shared-options: -Werror' makes the package easy to break with future GHC versions because new GHC versions often add new warnings. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/cabal.out b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/cabal.out new file mode 100644 index 00000000000..2c662d91fd5 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/cabal.out @@ -0,0 +1,4 @@ +# cabal check +Warning: Unrecognised ignore "foo" +These warnings will likely cause trouble when distributing the package: +Warning: [short-description] The 'description' field should be longer than the 'synopsis' field. It's useful to provide an informative 'description' to allow Haskell programmers who have never heard about your package to understand the purpose of your package. The 'description' field content is typically shown by tooling (e.g. 'cabal info', Haddock, Hackage) below the 'synopsis' which serves as a headline. Please refer to for more details. diff --git a/cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/cabal.test.hs b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/cabal.test.hs new file mode 100644 index 00000000000..c0e53a59ceb --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/cabal.test.hs @@ -0,0 +1,4 @@ +import Test.Cabal.Prelude + +-- Warns (but does not error) when an ignore option is not recognised. +main = cabalTest $ cabal "check" ["--ignore=foo"] diff --git a/cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/pkg.cabal b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/pkg.cabal new file mode 100644 index 00000000000..a017b6f56bd --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Missing/pkg.cabal @@ -0,0 +1,13 @@ +cabal-version: 2.2 +name: pkg +version: 0 +category: example +maintainer: none@example.com +synopsis: very big synopsis +description: short desc +license: BSD-3-Clause + +library + exposed-modules: Foo + default-language: Haskell2010 + diff --git a/cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/cabal.out b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/cabal.out new file mode 100644 index 00000000000..37aa169b416 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/cabal.out @@ -0,0 +1,2 @@ +# cabal check +No errors or warnings could be found in the package. diff --git a/cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/cabal.test.hs b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/cabal.test.hs new file mode 100644 index 00000000000..7b06be026b6 --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/cabal.test.hs @@ -0,0 +1,4 @@ +import Test.Cabal.Prelude + +-- Should ignore warnings if instructed so. +main = cabalTest $ cabal "check" ["--ignore=short-description"] diff --git a/cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/pkg.cabal b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/pkg.cabal new file mode 100644 index 00000000000..a017b6f56bd --- /dev/null +++ b/cabal-testsuite/PackageTests/Check/IgnoreWarning/Ok/pkg.cabal @@ -0,0 +1,13 @@ +cabal-version: 2.2 +name: pkg +version: 0 +category: example +maintainer: none@example.com +synopsis: very big synopsis +description: short desc +license: BSD-3-Clause + +library + exposed-modules: Foo + default-language: Haskell2010 + diff --git a/cabal-testsuite/PackageTests/Check/InvalidGlob/cabal.out b/cabal-testsuite/PackageTests/Check/InvalidGlob/cabal.out index b97dc6df39a..7e0db864cbd 100644 --- a/cabal-testsuite/PackageTests/Check/InvalidGlob/cabal.out +++ b/cabal-testsuite/PackageTests/Check/InvalidGlob/cabal.out @@ -1,5 +1,5 @@ # cabal check The following errors will cause portability problems on other environments: -Error: No 'synopsis' or 'description' field. -Error: In the 'extra-doc-files' field: invalid file glob '***.html'. Wildcards '*' may only totally replace the file's base name, not only parts of it. +Error: [no-syn-desc] No 'synopsis' or 'description' field. +Error: [glob-syntax-error] In the 'extra-doc-files' field: invalid file glob '***.html'. Wildcards '*' may only totally replace the file's base name, not only parts of it. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/MissingGlobDirectory/cabal.out b/cabal-testsuite/PackageTests/Check/MissingGlobDirectory/cabal.out index 8b7eb933524..7c5a77b0af7 100644 --- a/cabal-testsuite/PackageTests/Check/MissingGlobDirectory/cabal.out +++ b/cabal-testsuite/PackageTests/Check/MissingGlobDirectory/cabal.out @@ -1,6 +1,6 @@ # cabal check 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. -Warning: In 'extra-source-files': the pattern 'file-not-a-directory/*.js' attempts to match files in the directory 'file-not-a-directory', but there is no directory by that name. +Warning: [glob-missing-dir] 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: [glob-missing-dir] 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: [glob-missing-dir] 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. +Warning: [glob-missing-dir] In 'extra-source-files': the pattern 'file-not-a-directory/*.js' attempts to match files in the directory 'file-not-a-directory', but there is no directory by that name. diff --git a/cabal-testsuite/PackageTests/Check/MissingGlobDirectory2/cabal.out b/cabal-testsuite/PackageTests/Check/MissingGlobDirectory2/cabal.out index 61c410c936f..5aff271d3a7 100644 --- a/cabal-testsuite/PackageTests/Check/MissingGlobDirectory2/cabal.out +++ b/cabal-testsuite/PackageTests/Check/MissingGlobDirectory2/cabal.out @@ -1,5 +1,5 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: In 'extra-source-files': the pattern 'dir/*.html' does not match any files. -Warning: In 'extra-source-files': the pattern 'dir/*.html' does not match the file 'dir/foo.en.html' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 2.4' or higher. -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: [no-glob-match] In 'extra-source-files': the pattern 'dir/*.html' does not match any files. +Warning: [glob-no-extension] In 'extra-source-files': the pattern 'dir/*.html' does not match the file 'dir/foo.en.html' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 2.4' or higher. +Warning: [glob-missing-dir] 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. diff --git a/cabal-testsuite/PackageTests/Check/MultiDotGlob2.2/check.out b/cabal-testsuite/PackageTests/Check/MultiDotGlob2.2/check.out index 6769dd25153..ecf53a612e1 100644 --- a/cabal-testsuite/PackageTests/Check/MultiDotGlob2.2/check.out +++ b/cabal-testsuite/PackageTests/Check/MultiDotGlob2.2/check.out @@ -1,5 +1,5 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: In 'data-files': the pattern 'data/*.dat' does not match the file 'data/foo.bar.dat' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 2.4' or higher. -Warning: In 'extra-doc-files': the pattern 'doc/*.html' does not match the file 'doc/foo.en.html' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 2.4' or higher. -Warning: In 'extra-doc-files': the pattern 'doc/*.html' does not match the file 'doc/foo.fr.html' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 2.4' or higher. +Warning: [glob-no-extension] In 'data-files': the pattern 'data/*.dat' does not match the file 'data/foo.bar.dat' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 2.4' or higher. +Warning: [glob-no-extension] In 'extra-doc-files': the pattern 'doc/*.html' does not match the file 'doc/foo.en.html' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 2.4' or higher. +Warning: [glob-no-extension] In 'extra-doc-files': the pattern 'doc/*.html' does not match the file 'doc/foo.fr.html' because the extensions do not exactly match (e.g., foo.en.html does not exactly match *.html). To enable looser suffix-only matching, set 'cabal-version: 2.4' or higher. diff --git a/cabal-testsuite/PackageTests/Check/NoGlobMatches/cabal.out b/cabal-testsuite/PackageTests/Check/NoGlobMatches/cabal.out index bee06362960..f47cff76f82 100644 --- a/cabal-testsuite/PackageTests/Check/NoGlobMatches/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NoGlobMatches/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: In 'extra-doc-files': the pattern '*.html' does not match any files. +Warning: [no-glob-match] In 'extra-doc-files': the pattern '*.html' does not match any files. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownArch/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownArch/cabal.out index 38b924bc1d1..9efd7191156 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownArch/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownArch/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: Unknown architecture name 'subleq' +Error: [unknown-arch] Unknown architecture name 'subleq' Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownCompiler/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownCompiler/cabal.out index 58e4a87eb92..e0cb477b74a 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownCompiler/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownCompiler/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: Unknown compiler name 'MHC' +Error: [unknown-compiler] Unknown compiler name 'MHC' Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownOS/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownOS/cabal.out index d033025ea51..cc64fa8749f 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownOS/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownOS/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: Unknown operating system name 'plan9' +Error: [unknown-os] Unknown operating system name 'plan9' Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/DebugFlag/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/DebugFlag/cabal.out index d4729a6f484..4af99700027 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/DebugFlag/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/DebugFlag/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: 'ghc-prof-options: -d*' debug flags are not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. +Error: [debug-flag] 'ghc-prof-options: -d*' debug flags are not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/ElseCheck/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/ElseCheck/cabal.out index a5ef963c71f..d74b60c5d26 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/ElseCheck/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/ElseCheck/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: 'ghc-options: -j[N]' can make sense for a particular user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. +Error: [unneeded-j] 'ghc-options: -j[N]' can make sense for a particular user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/FDeferTypeErrors/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/FDeferTypeErrors/cabal.out index 1318b007be4..57bed9ce2b4 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/FDeferTypeErrors/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/FDeferTypeErrors/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: 'ghc-options: -fdefer-type-errors' is fine during development but is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. +Error: [fdefer-type-errors] 'ghc-options: -fdefer-type-errors' is fine during development but is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/Jn/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/Jn/cabal.out index b3217c803cf..96556490f23 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/Jn/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/Jn/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: 'ghc-shared-options: -j[N]' can make sense for a particular user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. +Error: [unneeded-j] 'ghc-shared-options: -j[N]' can make sense for a particular user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/Profiling/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/Profiling/cabal.out index 5426d7774e9..c6040f523c0 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/Profiling/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/Profiling/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: 'ghc-shared-options: -fprof*' profiling flags are typically not appropriate for a distributed library package. These flags are useful to profile this package, but when profiling other packages that use this one these flags clutter the profile output with excessive detail. If you think other packages really want to see cost centres from this package then use '-fprof-auto-exported' which puts cost centres only on exported functions. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. +Warning: [fprof-flag] 'ghc-shared-options: -fprof*' profiling flags are typically not appropriate for a distributed library package. These flags are useful to profile this package, but when profiling other packages that use this one these flags clutter the profile output with excessive detail. If you think other packages really want to see cost centres from this package then use '-fprof-auto-exported' which puts cost centres only on exported functions. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/WError/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/WError/cabal.out index 1edd7773b26..3fae80d3802 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/WError/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/DevOnlyFlags/WError/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: 'ghc-prof-options: -Werror' makes the package easy to break with future GHC versions because new GHC versions often add new warnings. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. +Error: [werror] 'ghc-prof-options: -Werror' makes the package easy to break with future GHC versions because new GHC versions often add new warnings. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/DuplicatedModules/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/DuplicatedModules/cabal.out index 15bd94c337d..9c25b3cf526 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/DuplicatedModules/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/DuplicatedModules/cabal.out @@ -1,4 +1,4 @@ # cabal check The package will not build sanely due to these errors: -Error: Duplicate modules in library: Foo +Error: [duplicate-modules] Duplicate modules in library: Foo Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersions/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersions/cabal.out index 06d7bb58ed7..d87292f7506 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersions/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersions/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The dependency 'build-depends: base' does not specify an upper bound on the version number. Each major release of the 'base' package changes the API in various ways and most packages will need some changes to compile with it. The recommended practice is to specify an upper bound on the version of the 'base' package. This ensures your package will continue to build when a new major version of the 'base' package is released. If you are not sure what upper bound to use then use the next major version. For example if you have tested your package with 'base' version 4.5 and 4.6 then use 'build-depends: base >= 4.5 && < 4.7'. +Error: [missing-bounds-important] The dependency 'build-depends: base' does not specify an upper bound on the version number. Each major release of the 'base' package changes the API in various ways and most packages will need some changes to compile with it. The recommended practice is to specify an upper bound on the version of the 'base' package. This ensures your package will continue to build when a new major version of the 'base' package is released. If you are not sure what upper bound to use then use the next major version. For example if you have tested your package with 'base' version 4.5 and 4.6 then use 'build-depends: base >= 4.5 && < 4.7'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsInternalSimple/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsInternalSimple/cabal.out index ff21f73f613..2c1d8a72480 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsInternalSimple/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsInternalSimple/cabal.out @@ -1,5 +1,5 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: On executable 'prova', these packages miss upper bounds: -- acme-box +Warning: [missing-upper-bounds] On executable 'prova', these packages miss upper bounds: + - acme-box Please add them. There is more information at https://pvp.haskell.org/ diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsLibInt/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsLibInt/cabal.out index e0821ac6ea5..c9f531cbd6e 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsLibInt/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/PackageVersionsLibInt/cabal.out @@ -1,5 +1,5 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: On library 'int-lib', these packages miss upper bounds: -- text +Warning: [missing-upper-bounds] On library 'int-lib', these packages miss upper bounds: + - text Please add them. There is more information at https://pvp.haskell.org/ diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/PathsExtensions/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/PathsExtensions/cabal.out index eb486dcb3af..0dd3070ddc5 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/PathsExtensions/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/PathsExtensions/cabal.out @@ -1,5 +1,5 @@ # cabal check The package will not build sanely due to these errors: -Error: Packages using RebindableSyntax with OverloadedStrings or OverloadedLists in default-extensions, in conjunction with the autogenerated module Paths_*, are known to cause compile failures with Cabal < 2.2. To use these default-extensions with a Paths_* autogen module, specify at least 'cabal-version: 2.2'. -Error: Packages using RebindableSyntax with OverloadedStrings or OverloadedLists in default-extensions, in conjunction with the autogenerated module PackageInfo_*, are known to cause compile failures with Cabal < 2.2. To use these default-extensions with a PackageInfo_* autogen module, specify at least 'cabal-version: 2.2'. +Error: [rebindable-clash-paths] Packages using RebindableSyntax with OverloadedStrings or OverloadedLists in default-extensions, in conjunction with the autogenerated module Paths_*, are known to cause compile failures with Cabal < 2.2. To use these default-extensions with a Paths_* autogen module, specify at least 'cabal-version: 2.2'. +Error: [rebindable-clash-info] Packages using RebindableSyntax with OverloadedStrings or OverloadedLists in default-extensions, in conjunction with the autogenerated module PackageInfo_*, are known to cause compile failures with Cabal < 2.2. To use these default-extensions with a PackageInfo_* autogen module, specify at least 'cabal-version: 2.2'. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/SetupBounds/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/SetupBounds/cabal.out index 92ab0bfbca4..895d3a63943 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/SetupBounds/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/SetupBounds/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The dependency 'setup-depends: 'base' does not specify an upper bound on the version number. Each major release of the 'base' package changes the API in various ways and most packages will need some changes to compile with it. If you are not sure what upper bound to use then use the next major version. +Error: [missing-bounds-setup] The dependency 'setup-depends: 'base' does not specify an upper bound on the version number. Each major release of the 'base' package changes the API in various ways and most packages will need some changes to compile with it. If you are not sure what upper bound to use then use the next major version. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/NonConfCheck/UnusedFlags/cabal.out b/cabal-testsuite/PackageTests/Check/NonConfCheck/UnusedFlags/cabal.out index 0d5d79b1d42..9d1c114eaeb 100644 --- a/cabal-testsuite/PackageTests/Check/NonConfCheck/UnusedFlags/cabal.out +++ b/cabal-testsuite/PackageTests/Check/NonConfCheck/UnusedFlags/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: Declared and used flag sets differ: test-flag /= . +Warning: [unused-flag] Declared and used flag sets differ: test-flag /= . diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/BOM/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/BOM/cabal.out index 82d2a821f0a..f4375d24f23 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/BOM/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/BOM/cabal.out @@ -1,6 +1,6 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: pkg.cabal:1:1: Byte-order mark found at the beginning of the file +Warning: [parser-warning] pkg.cabal:1:1: Byte-order mark found at the beginning of the file The following errors will cause portability problems on other environments: -Error: ./pkg.cabal starts with an Unicode byte order mark (BOM). This may cause problems with older cabal versions. +Error: [bom] ./pkg.cabal starts with an Unicode byte order mark (BOM). This may cause problems with older cabal versions. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/ExtensionMatch/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/ExtensionMatch/cabal.out index 5ff791257ae..434547b4082 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/ExtensionMatch/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/ExtensionMatch/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: In the 'extra-doc-files' field: invalid file glob '***.html'. Wildcards '*' may only totally replace the file's base name, not only parts of it. +Error: [glob-syntax-error] In the 'extra-doc-files' field: invalid file glob '***.html'. Wildcards '*' may only totally replace the file's base name, not only parts of it. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/FileName/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/FileName/cabal.out index ea4a2e848fe..40bfc4833cc 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/FileName/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/FileName/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The filename './pkg.cabal' does not match package name (expected: 'package.cabal') +Error: [name-no-match] The filename './pkg.cabal' does not match package name (expected: 'package.cabal') Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/LocalPaths/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/LocalPaths/cabal.out index f81379a29af..7525ca851e0 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/LocalPaths/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/LocalPaths/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: 'extra-lib-dirs: lib-folder' specifies a directory which does not exist. +Error: [unknown-directory] 'extra-lib-dirs: lib-folder' specifies a directory which does not exist. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/cabal.out index a90fc5b1975..a92251c0ad7 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V1.12/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: Please consider including the file './ChangeLog.md' in the 'extra-source-files' section of the .cabal file if it contains useful information for users of the package. +Warning: [no-docs] Please consider including the file './ChangeLog.md' in the 'extra-source-files' section of the .cabal file if it contains useful information for users of the package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.out index b8699cb6a6a..7ef1e41bdce 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/NotIncluded/V3.0/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: Please consider including the file './CHANGELOG.TXT' in the 'extra-doc-files' section of the .cabal file if it contains useful information for users of the package. +Warning: [no-docs] Please consider including the file './CHANGELOG.TXT' in the 'extra-doc-files' section of the .cabal file if it contains useful information for users of the package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/cabal.out index 729191e540a..32b8c3a1078 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V1.12/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: Please consider moving the file 'ChangeLog.md' from the 'data-files' section of the .cabal file to the section 'extra-source-files'. +Warning: [doc-place] Please consider moving the file 'ChangeLog.md' from the 'data-files' section of the .cabal file to the section 'extra-source-files'. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/cabal.out index 8ae427d7c83..81945acc86f 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/MissingExpectedDocFiles/ChangeLog/WrongField/V3.0/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings may cause trouble when distributing the package: -Warning: Please consider moving the file 'ChangeLog.md' from the 'extra-source-files' section of the .cabal file to the section 'extra-doc-files'. +Warning: [doc-place] Please consider moving the file 'ChangeLog.md' from the 'extra-source-files' section of the .cabal file to the section 'extra-doc-files'. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/NoConfigureFile/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/NoConfigureFile/cabal.out index 1214a8d69e6..3674c003bfc 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/NoConfigureFile/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/NoConfigureFile/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: The 'build-type' is 'Configure' but there is no 'configure' script. You probably need to run 'autoreconf -i' to generate it. +Error: [missing-conf-script] The 'build-type' is 'Configure' but there is no 'configure' script. You probably need to run 'autoreconf -i' to generate it. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/NoLicenseFile/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/NoLicenseFile/cabal.out index 4dacea81900..240be1f84f3 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/NoLicenseFile/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/NoLicenseFile/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors are likely to affect your build negatively: -Error: The 'license-file' field refers to the file 'LICENSE' which does not exist. +Error: [unknown-file] The 'license-file' field refers to the file 'LICENSE' which does not exist. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/NoSetupFile/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/NoSetupFile/cabal.out index 45e20002892..09b4b408375 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/NoSetupFile/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/NoSetupFile/cabal.out @@ -1,4 +1,4 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The package is missing a Setup.hs or Setup.lhs script. +Error: [missing-setup] The package is missing a Setup.hs or Setup.lhs script. Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/PathTooLong/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/PathTooLong/cabal.out index 12ceb0f1ffc..70d686bdd04 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/PathTooLong/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/PathTooLong/cabal.out @@ -1,6 +1,6 @@ # cabal check The following errors will cause portability problems on other environments: -Error: The following file name is too long to store in a portable POSIX format tar archive. The maximum length for the name part (including extension) is 100 ASCII characters. The maximum length for any individual directory component is 155. +Error: [long-name] The following file name is too long to store in a portable POSIX format tar archive. The maximum length for the name part (including extension) is 100 ASCII characters. The maximum length for any individual directory component is 155. The file in question is: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.hg Error: Hackage would reject this package. diff --git a/cabal-testsuite/PackageTests/Check/PackageFiles/VCSInfo/cabal.out b/cabal-testsuite/PackageTests/Check/PackageFiles/VCSInfo/cabal.out index b709524c109..aa0542c5735 100644 --- a/cabal-testsuite/PackageTests/Check/PackageFiles/VCSInfo/cabal.out +++ b/cabal-testsuite/PackageTests/Check/PackageFiles/VCSInfo/cabal.out @@ -1,3 +1,3 @@ # cabal check These warnings will likely cause trouble when distributing the package: -Warning: When distributing packages, it is encouraged to specify source control information in the .cabal file using one or more 'source-repository' sections. See the Cabal user guide for details. +Warning: [no-repository] When distributing packages, it is encouraged to specify source control information in the .cabal file using one or more 'source-repository' sections. See the Cabal user guide for details. diff --git a/cabal-testsuite/PackageTests/CustomPlain/setup.out b/cabal-testsuite/PackageTests/CustomPlain/setup.out index ba0be271fc7..3fdfe2b7f77 100644 --- a/cabal-testsuite/PackageTests/CustomPlain/setup.out +++ b/cabal-testsuite/PackageTests/CustomPlain/setup.out @@ -1,6 +1,6 @@ # Setup configure Configuring plain-0.1.0.0... -Warning: No 'build-type' specified. If you do not need a custom Setup.hs or ./configure script then use 'build-type: Simple'. +Warning: [no-build-type] No 'build-type' specified. If you do not need a custom Setup.hs or ./configure script then use 'build-type: Simple'. # Setup build Preprocessing library for plain-0.1.0.0... Building library for plain-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.cabal.out b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.cabal.out index b03e6765cb0..65ea4562009 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.cabal.out +++ b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.cabal.out @@ -1,4 +1,4 @@ # Setup configure Configuring build-depends-bad-version-0.1.0.0... Error: [Cabal-5559] -The package has an impossible version range for a dependency on an internal library: build-depends-bad-version >=2. This version range does not include the current package, and must be removed as the current package's library will always be used. +[impossible-dep] The package has an impossible version range for a dependency on an internal library: build-depends-bad-version >=2. This version range does not include the current package, and must be removed as the current package's library will always be used. diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.out b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.out index b03e6765cb0..65ea4562009 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.out +++ b/cabal-testsuite/PackageTests/InternalVersions/BuildDependsBad/setup.out @@ -1,4 +1,4 @@ # Setup configure Configuring build-depends-bad-version-0.1.0.0... Error: [Cabal-5559] -The package has an impossible version range for a dependency on an internal library: build-depends-bad-version >=2. This version range does not include the current package, and must be removed as the current package's library will always be used. +[impossible-dep] The package has an impossible version range for a dependency on an internal library: build-depends-bad-version >=2. This version range does not include the current package, and must be removed as the current package's library will always be used. diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.cabal.out b/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.cabal.out index 077f750b066..872eeee78c4 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.cabal.out +++ b/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.cabal.out @@ -1,4 +1,4 @@ # Setup configure Configuring build-tool-depends-bad-version-0.1.0.0... Error: [Cabal-5559] -The package has an impossible version range for a dependency on an internal executable: build-tool-depends-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used. +[impossible-dep-exe] The package has an impossible version range for a dependency on an internal executable: build-tool-depends-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used. diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.out b/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.out index 077f750b066..872eeee78c4 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.out +++ b/cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.out @@ -1,4 +1,4 @@ # Setup configure Configuring build-tool-depends-bad-version-0.1.0.0... Error: [Cabal-5559] -The package has an impossible version range for a dependency on an internal executable: build-tool-depends-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used. +[impossible-dep-exe] The package has an impossible version range for a dependency on an internal executable: build-tool-depends-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used. diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.cabal.out b/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.cabal.out index 68a45e22992..3ea7f8e2604 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.cabal.out +++ b/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.cabal.out @@ -1,4 +1,4 @@ # Setup configure Configuring build-tools-bad-version-0.1.0.0... Error: [Cabal-5559] -The package has an impossible version range for a dependency on an internal executable: build-tools-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used. +[impossible-dep-exe] The package has an impossible version range for a dependency on an internal executable: build-tools-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used. diff --git a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.out b/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.out index 68a45e22992..3ea7f8e2604 100644 --- a/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.out +++ b/cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.out @@ -1,4 +1,4 @@ # Setup configure Configuring build-tools-bad-version-0.1.0.0... Error: [Cabal-5559] -The package has an impossible version range for a dependency on an internal executable: build-tools-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used. +[impossible-dep-exe] The package has an impossible version range for a dependency on an internal executable: build-tools-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used. diff --git a/cabal-testsuite/PackageTests/Regression/T3847/setup.cabal.out b/cabal-testsuite/PackageTests/Regression/T3847/setup.cabal.out index df940b2d616..70fdaf03c9f 100644 --- a/cabal-testsuite/PackageTests/Regression/T3847/setup.cabal.out +++ b/cabal-testsuite/PackageTests/Regression/T3847/setup.cabal.out @@ -1,3 +1,3 @@ # Setup configure Configuring T3847-1.0... -Warning: Unknown extensions: ThisDoesNotExist +Warning: [unknown-extension] Unknown extensions: ThisDoesNotExist diff --git a/cabal-testsuite/PackageTests/Regression/T3847/setup.out b/cabal-testsuite/PackageTests/Regression/T3847/setup.out index df940b2d616..70fdaf03c9f 100644 --- a/cabal-testsuite/PackageTests/Regression/T3847/setup.out +++ b/cabal-testsuite/PackageTests/Regression/T3847/setup.out @@ -1,3 +1,3 @@ # Setup configure Configuring T3847-1.0... -Warning: Unknown extensions: ThisDoesNotExist +Warning: [unknown-extension] Unknown extensions: ThisDoesNotExist diff --git a/cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.out b/cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.out index 81f5bc74a66..110b6052642 100644 --- a/cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.out +++ b/cabal-testsuite/PackageTests/ShowBuildInfo/Complex/single.out @@ -7,11 +7,11 @@ In order, the following will be built: - Complex-0.1.0.0 (lib) (first run) - Complex-0.1.0.0 (exe:Complex) (first run) Configuring library for Complex-0.1.0.0... -Warning: 'hs-source-dirs: doesnt-exist' specifies a directory which does not exist. +Warning: [unknown-directory] 'hs-source-dirs: doesnt-exist' specifies a directory which does not exist. Preprocessing library for Complex-0.1.0.0... Building library for Complex-0.1.0.0... Configuring executable 'Complex' for Complex-0.1.0.0... -Warning: 'hs-source-dirs: doesnt-exist' specifies a directory which does not exist. +Warning: [unknown-directory] 'hs-source-dirs: doesnt-exist' specifies a directory which does not exist. Preprocessing executable 'Complex' for Complex-0.1.0.0... Building executable 'Complex' for Complex-0.1.0.0... # show-build-info Complex exe:Complex @@ -30,7 +30,7 @@ Preprocessing library for criterion-1.1.4.0... Building library for criterion-1.1.4.0... Installing library in Configuring benchmark 'complex-benchmarks' for Complex-0.1.0.0... -Warning: 'hs-source-dirs: doesnt-exist' specifies a directory which does not exist. +Warning: [unknown-directory] 'hs-source-dirs: doesnt-exist' specifies a directory which does not exist. Preprocessing benchmark 'complex-benchmarks' for Complex-0.1.0.0... Building benchmark 'complex-benchmarks' for Complex-0.1.0.0... # show-build-info Complex bench:complex-benchmarks @@ -45,7 +45,7 @@ Preprocessing library for test-framework-0.8.1.1... Building library for test-framework-0.8.1.1... Installing library in Configuring test suite 'func-test' for Complex-0.1.0.0... -Warning: 'hs-source-dirs: doesnt-exist' specifies a directory which does not exist. +Warning: [unknown-directory] 'hs-source-dirs: doesnt-exist' specifies a directory which does not exist. Preprocessing test suite 'func-test' for Complex-0.1.0.0... Building test suite 'func-test' for Complex-0.1.0.0... # show-build-info Complex test:func-test @@ -60,7 +60,7 @@ Preprocessing library for another-framework-0.8.1.1... Building library for another-framework-0.8.1.1... Installing library in Configuring test suite 'unit-test' for Complex-0.1.0.0... -Warning: 'hs-source-dirs: doesnt-exist' specifies a directory which does not exist. +Warning: [unknown-directory] 'hs-source-dirs: doesnt-exist' specifies a directory which does not exist. Preprocessing test suite 'unit-test' for Complex-0.1.0.0... Building test suite 'unit-test' for Complex-0.1.0.0... # show-build-info Complex test:unit-test diff --git a/changelog.d/pr-check-ignore b/changelog.d/pr-check-ignore new file mode 100644 index 00000000000..2d83cea5da0 --- /dev/null +++ b/changelog.d/pr-check-ignore @@ -0,0 +1,18 @@ +synopsis: Add `--ignore` to `cabal check` +packages: Cabal cabal-check +prs: #9442 +issues: #8587 + +description: { + +- `cabal check` can now ignore warning with `--ignore`. E.g. + `--ignore=missing-upper-bounds` will not display “Missing upper + bounds” warnings. +- `cabal check` output now prints the warning identifier too + (like `[no-category]`). +- `Distribution.PackageDescription.Check.Warning` now exports + `filterPackageChecksById`, this can be used by third-party + tools to filter warnings. + +} + diff --git a/doc/cabal-commands.rst b/doc/cabal-commands.rst index 5419186f73c..229a5b7a616 100644 --- a/doc/cabal-commands.rst +++ b/doc/cabal-commands.rst @@ -1172,6 +1172,11 @@ tricky GHC options, etc.). Run ``cabal check`` in the folder where your ``.cabal`` package file is. +.. option:: -i, --ignore=WARNING + + Ignore a specific type of warning (e.g. ``--ignore=missing-upper-bounds``). + Check the list of warnings for which constructor to use. + .. option:: -v[n], --verbose[=n] Control verbosity (n is 0--3, default verbosity level is 1). @@ -1183,139 +1188,143 @@ exits with ``1`` and Hackage will refuse the package. A list of all warnings with their constructor: -- ParseWarning: warnings inherited from parser. -- NoNameField: missing ``name`` field. -- NoVersionField: missing ``version`` field. -- NoTarget: missing target in ``.cabal``. -- UnnamedInternal: unnamed internal library. -- DuplicateSections: duplicate name in target. -- IllegalLibraryName: internal library with same name as package. -- NoModulesExposed: no module exposed in library. -- SignaturesCabal2: ``signatures`` used with ``cabal-version`` < 2.0 -- AutogenNotExposed: ``autogen-module`` neither in ``exposed-modules`` nor ``other-modules``. -- AutogenIncludesNotIncluded: ``autogen-include`` neither in ``include`` nor ``install-includes``. -- NoMainIs: missing ``main-is``. -- NoHsLhsMain: ``main-is`` is not ``.hs`` nor ``.lhs``. -- MainCCabal1_18: C-like source file in ``main-is`` with ``cabal-version`` < 1.18. -- AutogenNoOther: ``autogen-module`` not in ``other-modules``. -- AutogenIncludesNotIncludedExe: ``autogen-include`` not in ``includes``. -- TestsuiteTypeNotKnown: unknown test-suite type. -- TestsuiteNotSupported: unsupported test-suite type. -- BenchmarkTypeNotKnown: unknown benchmark type. -- BenchmarkNotSupported: unsupported benchmark type. -- NoHsLhsMainBench: ``main-is`` for benchmark is neither ``.hs`` nor ``.lhs``. -- InvalidNameWin: invalid package name on Windows. -- ZPrefix: package with ``z-`` prexif (reseved for Cabal. -- NoBuildType: missing ``build-type``. -- NoCustomSetup: ``custom-setup`` section without ``build-type: Custom`` -- UnknownCompilers: unknown compiler in ``tested-with``. -- UnknownLanguages: unknown languages. -- UnknownExtensions: unknown extensions. -- LanguagesAsExtension: languages listed as extensions. -- DeprecatedExtensions: deprecated extensions. -- MissingField: missing cabal field (one of ``category``, ``maintainer``, ``synopsis``, ``description``). -- SynopsisTooLong: ``synopsis`` longer than 80 characters. -- ShortDesc: ``description`` shorter than ``synopsis``. -- InvalidTestWith: invalid ``tested-with`` version range. -- ImpossibleInternalDep: impossible internal library version range dependency. -- ImpossibleInternalExe: impossible internal executable version range dependency. -- MissingInternalExe: missing internal executable. -- NONELicense: ``NONE`` in ``license`` field. -- NoLicense: no ``license`` field. -- AllRightsReservedLicense: all rights reserved license. -- LicenseMessParse: license not to be used with `cabal-version` < 1.4. -- UnrecognisedLicense: unknown license. -- UncommonBSD4: uncommon BSD (BSD4) license. -- UnknownLicenseVersion: unknown license version. -- NoLicenseFile: missing license file. -- UnrecognisedSourceRepo: unrecognised kind of source-repository. -- MissingType: missing ``type`` in ``source-repository``. -- MissingLocation: missing ``location`` in ``source-repository``. -- MissingModule: missing ``module`` in ``source-repository``. -- MissingTag: missing ``tag`` in ``source-repository``. -- SubdirRelPath: ``subdir`` in ``source-repository`` must be relative. -- SubdirGoodRelPath: malformed ``subdir`` in ``source-repository``. -- OptFasm: unnecessary ``-fasm``. -- OptViaC: unnecessary ``-fvia-C``. -- OptHpc: unnecessary ``-fhpc``. -- OptProf: unnecessary ``-prof``. -- OptO: unnecessary ``-o``. -- OptHide: unnecessary ``-hide-package``. -- OptMake: unnecessary ``--make``. -- OptONot: unnecessary disable optimisation flag. -- OptOOne: unnecessary optimisation flag (``-O1``). -- OptOTwo: unnecessary optimisation flag (``-O2``). -- OptSplitSections: unnecessary ``-split-section``. -- OptSplitObjs: unnecessary ``-split-objs``. -- OptWls: unnecessary ``-optl-Wl,-s``. -- OptExts: use ``extension`` field instead of ``-fglasgow-exts``. -- OptRts: unnecessary ``-rtsopts``. -- OptWithRts: unnecessary ``-with-rtsopts``. -- COptONumber: unnecessary ``-O[n]`` in C code. -- COptCPP: unportable ``-cpp-options`` flag. -- OptAlternatives: C-like options in wrong cabal field. -- RelativeOutside: relative path outside of source tree. -- AbsolutePath: absolute path where not allowed. -- BadRelativePath: malformed relative path. -- DistPoint: unreliable path pointing inside ``dist``. -- GlobSyntaxError: glob syntax error. -- RecursiveGlobInRoot: recursive glob including source control folders. -- InvalidOnWin: invalid path on Windows. -- FilePathTooLong: path too long. -- FilePathNameTooLong: path *name* too long (POSIX). -- FilePathSplitTooLong: path non portable (POSIX, split requirements). -- FilePathEmpty: empty path. -- CVTestSuite: ``test-suite`` used with ``cabal-version`` < 1.10. -- CVDefaultLanguage: ``default-language`` used with ``cabal-version`` < 1.10. -- CVDefaultLanguageComponent: missing ``default-language``. -- CVExtraDocFiles: `extra-doc-files` used with ``cabal-version`` < 1.18. -- CVMultiLib: multiple ``library`` sections with ``cabal-version`` < 2.0. -- CVReexported: ``reexported-modules`` with ``cabal-version`` < 1.22. -- CVMixins: ``mixins`` with ``cabal-version`` < 2.0. -- CVExtraFrameworkDirs: ``extra-framework-dirs`` with ``cabal-version`` < 1.24. -- CVDefaultExtensions: ``default-extensions`` with ``cabal-version`` < 1.10. -- CVExtensionsDeprecated: deprecated ``extensions`` field used with ``cabal-version`` ≥ 1.10 -- CVSources: ``asm-sources``, ``cmm-sources``, ``extra-bundled-libraries`` or ``extra-library-flavours`` used with ``cabal-version`` < 3.0. -- CVExtraDynamic: ``extra-dynamic-library-flavours`` used with cabal-version < 3.0. -- CVVirtualModules: ``virtual-modules`` used with cabal-version < 2.2. -- CVSourceRepository: ``source-repository`` used with ``cabal-version`` 1.6. -- CVExtensions: incompatible language extension with ``cabal-version``. -- CVCustomSetup: missing ``setup-depends`` field in ``custom-setup`` with ``cabal-version`` ≥ 1.24. -- CVExpliticDepsCustomSetup: missing dependencies in ``custom-setup`` with ``cabal-version`` ≥ 1.24. -- CVAutogenPaths: missing autogen ``Paths_*`` modules in ``autogen-modules`` (``cabal-version`` ≥ 2.0). -- CVAutogenPackageInfo: missing autogen ``PackageInfo_*`` modules in ``autogen-modules`` *and* ``exposed-modules``/``other-modules`` (``cabal-version`` ≥ 2.0). -- GlobNoMatch: glob pattern not matching any file. -- GlobExactMatch: glob pattern not matching any file becuase of lack of extension matching (`cabal-version` < 2.4). -- GlobNoDir: glob pattern trying to match a missing directory. -- UnknownOS: unknown operating system name in condition. -- UnknownArch: unknown architecture in condition. -- UnknownCompiler: unknown compiler in condition. -- BaseNoUpperBounds: missing upper bounds for important dependencies (``base``, and for ``custom-setup`` ``Cabal`` too). -- MissingUpperBounds: missing upper bound in dependency (excluding test-suites and benchmarks). -- SuspiciousFlagName: troublesome flag name (e.g. starting with a dash). -- DeclaredUsedFlags: unused user flags. -- NonASCIICustomField: non-ASCII characters in custom field. -- RebindableClashPaths: ``Rebindable Syntax`` with ``OverloadedStrings``/``OverloadedStrings`` plus autogenerated ``Paths_*`` modules with ``cabal-version`` < 2.2. -- RebindableClashPackageInfo: ``Rebindable Syntax`` with ``OverloadedStrings``/``OverloadedStrings`` plus autogenerated ``PackageInfo_*`` modules with ``cabal-version`` < 2.2. -- WErrorUnneeded: ``-WError`` not under a user flag. -- JUnneeded: suspicious ``-j[n]`` usage. -- FDeferTypeErrorsUnneeded: suspicious ``-fdefer-type-errors``. -- DynamicUnneeded: suspicious ``-d*`` debug flag for distributed package. -- ProfilingUnneeded: suspicious ``-fprof-*`` flag. -- UpperBoundSetup: missing upper bounds in ``setup-depends``. -- DuplicateModule: duplicate modules in target. -- PotentialDupModule: potential duplicate module in target (subject to conditionals). -- BOMStart: unicode byte order mark (BOM) character at start of file. -- NotPackageName: filename not matching ``name``. -- NoDesc: no ``.cabal`` file found in folder. -- MultiDesc: multiple ``.cabal`` files found in folder. -- UnknownFile: path refers to a file which does not exist. -- MissingSetupFile: missing ``Setup.hs`` or ``Setup.lsh``. -- MissingConfigureScript: missing ``configure`` script with ``build-type: Configure``. -- UnknownDirectory: paths refer to a directory which does not exist. -- MissingSourceControl: missing ``source-repository`` section. -- MissingExpectedDocFiles: missing expected documentation files (changelog). -- WrongFieldForExpectedDocFiles: documentation files listed in ``extra-source-files`` instead of ``extra-doc-files``. +- ``parser-warning``: inherited from parser. +- ``no-name-field``: missing ``name`` field. +- ``no-version-field``: missing ``version`` field. +- ``no-target``: missing target in ``.cabal``. +- ``unnamed-internal-library``: unnamed internal library. +- ``duplicate-sections``: duplicate name in target. +- ``illegal-library-name``: internal library with same name as package. +- ``no-modules-exposed``: no module exposed in library. +- ``signatures``: ``signatures`` used with ``cabal-version`` < 2.0. +- ``autogen-not-exposed``: ``autogen-module`` neither in ``exposed-modules`` nor ``other-modules``. +- ``autogen-not-included``: ``autogen-include`` neither in ``include`` nor ``install-includes``. +- ``no-main-is``: missing ``main-is``. +- ``unknown-extension-main``: ``main-is`` is not ``.hs`` nor ``.lhs``. +- ``c-like-main``: C-like source file in ``main-is`` with ``cabal-version`` < 1.18. +- ``autogen-other-modules``: ``autogen-module`` not in ``other-modules``. +- ``autogen-exe``: ``autogen-include`` not in ``includes``. +- ``unknown-testsuite-type``: unknown test-suite type. +- ``unsupported-testsuite``: unsupported test-suite type. +- ``unknown-bench``: unknown benchmark type. +- ``unsupported-bench``: unsupported benchmark type. +- ``bench-unknown-extension``: ``main-is`` for benchmark is neither ``.hs`` nor ``.lhs``. +- ``invalid-name-win``: invalid package name on Windows. +- ``reserved-z-prefix``: package with ``z-`` prexif (reseved for Cabal. +- ``no-build-type``: missing ``build-type``. +- ``undeclared-custom-setup``: ``custom-setup`` section without ``build-type: Custom`` +- ``unknown-compiler-tested``: unknown compiler in ``tested-with``. +- ``unknown-languages``: unknown languages. +- ``unknown-extension``: unknown extensions. +- ``languages-as-extensions``: languages listed as extensions. +- ``deprecated-extensions``: deprecated extensions. +- ``no-category``: missing ``category`` field. +- ``no-maintainer``: missing ``maintainer`` field. +- ``no-synopsis``: missing ``synopsis`` field. +- ``no-description``: missing ``description`` field. +- ``no-syn-desc``: missing ``synopsis`` or ``description`` field. +- ``long-synopsis``: ``synopsis`` longer than 80 characters. +- ``short-description``: ``description`` shorter than ``synopsis``. +- ``invalid-range-tested``: invalid ``tested-with`` version range. +- ``impossible-dep``: impossible internal library version range dependency. +- ``impossible-dep-exe``: impossible internal executable version range dependency. +- ``no-internal-exe``: missing internal executable. +- ``license-none``: ``NONE`` in ``license`` field. +- ``no-license``: no ``license`` field. +- ``all-rights-reserved``: “All rights reserved” license. +- ``license-parse``: license not to be used with ``cabal-version`` < 1.4. +- ``unknown-license``: unknown license. +- ``bsd4-license``: uncommon BSD (BSD4) license. +- ``unknown-license-version``: unknown license version. +- ``no-license-file``: missing license file. +- ``unrecognised-repo-type``: unrecognised kind of source-repository. +- ``repo-no-type``: missing ``type`` in ``source-repository``. +- ``repo-no-location``: missing ``location`` in ``source-repository``. +- ``repo-no-module``: missing ``module`` in ``source-repository``. +- ``repo-no-tag``: missing ``tag`` in ``source-repository``. +- ``repo-relative-dir``: ``subdir`` in ``source-repository`` must be relative. +- ``repo-malformed-subdir``: malformed ``subdir`` in ``source-repository``. +- ``option-fasm``: unnecessary ``-fasm``. +- ``option-fhpc``: unnecessary ``-fhpc``. +- ``option-prof``: unnecessary ``-prof``. +- ``option-o``: unnecessary ``-o``. +- ``option-hide-package``: unnecessary ``-hide-package``. +- ``option-make``: unnecessary ``--make``. +- ``option-optimize``: unnecessary disable optimization flag. +- ``option-o1``: unnecessary optimisation flag (``-O1``). +- ``option-o2``: unnecessary optimisation flag (``-O2``). +- ``option-split-section``: unnecessary ``-split-section``. +- ``option-split-objs``: unnecessary ``-split-objs``. +- ``option-optl-wl``:unnecessary ``-optl-Wl,-s``. +- ``use-extension``: use ``extension`` field instead of ``-fglasgow-exts``. +- ``option-rtsopts``: unnecessary ``-rtsopts``. +- ``option-with-rtsopts``: unnecessary ``-with-rtsopts``. +- ``option-opt-c``: unnecessary ``-O[n]`` in C code. +- ``cpp-options``: unportable ``-cpp-options`` flag. +- ``misplaced-c-opt``: C-like options in wrong cabal field. +- ``relative-path-outside``: relative path outside of source tree. +- ``absolute-path``: absolute path where not allowed. +- ``malformed-relative-path``: malformed relative path. +- ``unreliable-dist-path``: unreliable path pointing inside ``dist``. +- ``glob-syntax-error``: glob syntax error. +- ``recursive-glob``: recursive glob including source control folders. +- ``invalid-path-win``: invalid path on Windows. +- ``long-path``: path too long (POSIX, 255 ASCII chars). +- ``long-name``: path *name* too long (POSIX, 100 ASCII chars). +- ``name-not-portable``: path non portable (POSIX, split requirements). +- ``empty-path``: empty path. +- ``test-cabal-ver``: ``test-suite`` used with ``cabal-version`` < 1.10. +- ``default-language``: ``default-language`` used with ``cabal-version`` < 1.10. +- ``no-default-language``: missing ``default-language``. +- ``extra-doc-files``: ``extra-doc-files`` used with ``cabal-version`` < 1.18. +- ``multilib``: multiple ``library`` sections with ``cabal-version`` < 2.0. +- ``reexported-modules``: ``reexported-modules`` with ``cabal-version`` < 1.22. +- ``mixins``: ``mixins`` with ``cabal-version`` < 2.0. +- ``extra-framework-dirs``: ``extra-framework-dirs`` with ``cabal-version`` < 1.24. +- ``default-extensions``: ``default-extensions`` with ``cabal-version`` < 1.10. +- ``extensions-field``: deprecated ``extensions`` field used with ``cabal-version`` ≥ 1.10 +- ``unsupported-sources``: ``asm-sources``, ``cmm-sources``, ``extra-bundled-libraries`` or ``extra-library-flavours`` used with ``cabal-version`` < 3.0. +- ``extra-dynamic``: ``extra-dynamic-library-flavours`` used with cabal-version < 3.0. +- ``virtual-modules``: ``virtual-modules`` used with cabal-version < 2.2. +- ``source-repository``: ``source-repository`` used with ``cabal-version`` 1.6. +- ``incompatible-extension``: incompatible language extension with ``cabal-version``. +- ``no-setup-depends``: missing ``setup-depends`` field in ``custom-setup`` with ``cabal-version`` ≥ 1.24. +- ``dependencies-setup``: missing dependencies in ``custom-setup`` with ``cabal-version`` ≥ 1.24. +- ``no-autogen-paths``: missing autogen ``Paths_*`` modules in ``autogen-modules`` (``cabal-version`` ≥ 2.0). +- ``no-autogen-pinfo``: missing autogen ``PackageInfo_*`` modules in ``autogen-modules`` *and* ``exposed-modules``/``other-modules`` (``cabal-version`` ≥ 2.0). +- ``no-glob-match``: glob pattern not matching any file. +- ``glob-no-extension``: glob pattern not matching any file becuase of lack of extension matching (`cabal-version` < 2.4). +- ``glob-missing-dir``: glob pattern trying to match a missing directory. +- ``unknown-os``: unknown operating system name in condition. +- ``unknown-arch``: unknown architecture in condition. +- ``unknown-compiler``: unknown compiler in condition. +- ``missing-bounds-important``: missing upper bounds for important dependencies (``base``, and for ``custom-setup`` ``Cabal`` too). +- ``missing-upper-bounds``: missing upper bound in dependency (excluding test-suites and benchmarks). +- ``suspicious-flag``: troublesome flag name (e.g. starting with a dash). +- ``unused-flag``: unused user flags. +- ``non-ascii``: non-ASCII characters in custom field. +- ``rebindable-clash-paths``: ``Rebindable Syntax`` with ``OverloadedStrings``/``OverloadedStrings`` plus autogenerated ``Paths_*`` modules with ``cabal-version`` < 2.2. +- ``rebindable-clash-info``: ``Rebindable Syntax`` with ``OverloadedStrings``/``OverloadedStrings`` plus autogenerated ``PackageInfo_*`` modules with ``cabal-version`` < 2.2. +- ``werror``: ``-WError`` not under a user flag. +- ``unneeded-j``: suspicious ``-j[n]`` usage. +- ``fdefer-type-errors``: suspicious ``-fdefer-type-errors``. +- ``debug-flag``: suspicious ``-d*`` debug flag for distributed package. +- ``fprof-flag``: suspicious ``-fprof-*`` flag. +- ``missing-bounds-setup``: missing upper bounds in ``setup-depends``. +- ``duplicate-modules``: duplicate modules in target. +- ``maybe-duplicate-modules``: potential duplicate module in target (subject to conditionals). +- ``bom``: unicode byte order mark (BOM) character at start of file. +- ``name-no-match``: filename not matching ``name``. +- ``no-cabal-file``: no ``.cabal`` file found in folder. +- ``multiple-cabal-file``: multiple ``.cabal`` files found in folder. +- ``unknown-file``: path refers to a file which does not exist. +- ``missing-setup``: missing ``Setup.hs`` or ``Setup.lsh``. +- ``missing-conf-script``: missing ``configure`` script with ``build-type: Configure``. +- ``unknown-directory``: paths refer to a directory which does not exist. +- ``no-repository``: missing ``source-repository`` section. +- ``no-docs``: missing expected documentation files (changelog). +- ``doc-place``: documentation files listed in ``extra-source-files`` instead of ``extra-doc-files``. + cabal sdist ^^^^^^^^^^^