Skip to content

Commit

Permalink
Add -Wunused-packages to the packages
Browse files Browse the repository at this point in the history
Cabal, Cabal-syntax, cabal-install, cabal-install-solver
  • Loading branch information
Kleidukos committed Jan 26, 2024
1 parent 3a55da1 commit d7bd562
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Cabal-syntax/Cabal-syntax.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ library
if impl(ghc >= 8.0) && impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances

if impl(ghc >= 8.10)
ghc-options: -Wunused-packages

build-tool-depends: alex:alex

exposed-modules:
Expand Down
5 changes: 4 additions & 1 deletion Cabal/Cabal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ library
else
build-depends: unix >= 2.6.0.0 && < 2.9

ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates
ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates -Wunused-packages

if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wnoncanonical-monad-instances

if impl(ghc >= 8.0) && impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances

if impl(ghc >= 8.10)
ghc-options: -Wunused-packages

exposed-modules:
Distribution.Backpack.Configure
Distribution.Backpack.ComponentsGraph
Expand Down
2 changes: 2 additions & 0 deletions cabal-install-solver/cabal-install-solver.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ library
ghc-options:
-Wall -Wcompat -Wnoncanonical-monad-instances
-fwarn-tabs -fwarn-incomplete-uni-patterns
-WUnused-packages

if impl(ghc <8.8)
ghc-options: -Wnoncanonical-monadfail-instances

if impl(ghc >=8.10)
ghc-options: -Wunused-packages

Expand Down
7 changes: 6 additions & 1 deletion cabal-install/cabal-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ Flag lukko
manual: True

common warnings
ghc-options: -Wall -Wcompat -Wnoncanonical-monad-instances -Wincomplete-uni-patterns -Wincomplete-record-updates
ghc-options: -Wall -Wcompat -Wnoncanonical-monad-instances -Wincomplete-uni-patterns -Wincomplete-record-updates -Wunused-packages

if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances

if impl(ghc >= 8.10)
ghc-options: -Wunused-packages

if impl(ghc >=9.0)
-- Warning: even though introduced with GHC 8.10, -Wunused-packages
-- gives false positives with GHC 8.10.
Expand Down

0 comments on commit d7bd562

Please sign in to comment.