File tree Expand file tree Collapse file tree 5 files changed +12
-8
lines changed Expand file tree Collapse file tree 5 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -159,12 +159,12 @@ configGrammar = Config
159159 ^^^ metaActionHelp " PATCH" " file" " .patch files to apply to the generated Travis YAML file"
160160 <*> monoidalFieldAla " github-patches" (C. alaList' C. NoCommaFSep C. Token' ) (field @ " cfgGitHubPatches" )
161161 ^^^ metaActionHelp " PATCH" " file" " .patch files to apply to the generated GitHub Actions YAML file"
162- <*> booleanFieldDef " insert-version" (field @ " cfgInsertVersion" ) defaultConfig
162+ <*> booleanFieldDef " insert-version" (field @ " cfgInsertVersion" ) defaultConfig
163163 ^^^ help " Don't insert the haskell-ci version into the generated Travis YAML file"
164- <*> optionalFieldDef " error-missing-methods" (field @ " cfgErrorMissingMethods" ) defaultConfig
164+ <*> optionalFieldDef " error-missing-methods" (field @ " cfgErrorMissingMethods" ) defaultConfig
165165 ^^^ metahelp " PKGSCOPE" " Insert -Werror=missing-methods for package scope (none, local, all)"
166- <*> booleanFieldDef " error-unused-packages" (field @ " cfgErrorUnusedPkgs" ) defaultConfig
167- ^^^ help " Insert -Werror=unused-packages"
166+ <*> rangeField " error-unused-packages" (field @ " cfgErrorUnusedPkgs" ) defaultConfig
167+ ^^^ metahelp " RANGE " " Insert -Werror=unused-packages"
168168 <*> blurFieldGrammar (field @ " cfgDoctest" ) doctestConfigGrammar defaultConfig
169169 <*> blurFieldGrammar (field @ " cfgDocspec" ) docspecConfigGrammar defaultConfig
170170 <*> pure [] -- constraint sets
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ configHistory =
8383 , ver 0 19 20250606 := \ cfg -> cfg
8484 & field @ " cfgDocspec" . field @ " cfgDocspecUrl" .~ " https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20250606/cabal-docspec-0.0.0.20250606-x86_64-linux.xz"
8585 & field @ " cfgDocspec" . field @ " cfgDocspecHash" .~ " cc20bb5c19501b42bde77556bc419c7c0a5c8d1eb65663024d8a4e4c868bef25"
86+ , ver 0 19 20250708 := \ cfg -> cfg
87+ & field @ " cfgErrorUnusedPkgs" .~ C. orLaterVersion (C. mkVersion [9 ,4 ])
8688 ]
8789 where
8890 ver x y z = [x, y, z]
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ initialConfig = Config
7474 , cfgGitHubPatches = []
7575 , cfgInsertVersion = True
7676 , cfgErrorMissingMethods = PackageScopeLocal
77- , cfgErrorUnusedPkgs = True -- TODO: False
77+ , cfgErrorUnusedPkgs = noVersion
7878 , cfgDoctest = initialDoctestConfig
7979 , cfgDocspec = initialDocspecConfig
8080 , cfgConstraintSets = []
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ data Config = Config
7474 , cfgGitHubPatches :: [FilePath ]
7575 , cfgInsertVersion :: ! Bool
7676 , cfgErrorMissingMethods :: ! PackageScope
77- , cfgErrorUnusedPkgs :: ! Bool
77+ , cfgErrorUnusedPkgs :: ! VersionRange
7878 , cfgDoctest :: ! DoctestConfig
7979 , cfgDocspec :: ! DocspecConfig
8080 , cfgConstraintSets :: [ConstraintSet ]
Original file line number Diff line number Diff line change @@ -356,8 +356,10 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
356356 , " ghc-options: -Werror=missing-methods -Werror=missing-fields"
357357 ]
358358
359- when cfgErrorUnusedPkgs $ for_ pkgs $ \ Pkg {pkgName,pkgJobs} -> do
360- let range = Range (C. orLaterVersion (C. mkVersion [9 ,4 ])) /\ RangePoints pkgJobs
359+ -- -Werror-unused-pkgs
360+ for_ pkgs $ \ Pkg {pkgName,pkgJobs} -> do
361+ -- is introduced in 8.10.
362+ let range = Range cfgErrorUnusedPkgs /\ Range (C. orLaterVersion (C. mkVersion [8 ,10 ])) /\ RangePoints pkgJobs
361363 echo_if_to range " cabal.project" $ " package " ++ pkgName
362364 echo_if_to range " cabal.project" $ " ghc-options: -Werror=unused-packages"
363365
You can’t perform that action at this time.
0 commit comments