mirror of
https://github.com/xmonad/xmonad.git
synced 2025-07-25 17:21:52 -07:00
Conditionally error on unused imports
This turns off the warnings about unused imports _unless_ one is using the oldest supported version of GHC (right now that's 8.4.4 or older); then it turns them into errors! This prevents xmonad from emitting warnings about imports that have to be there due to backwards compatibility, but are obsolete in newer versions (think MFP), while at the same time preventing bitrot.
This commit is contained in:
12
xmonad.cabal
12
xmonad.cabal
@@ -84,7 +84,11 @@ library
|
||||
, setlocale
|
||||
, unix
|
||||
, utf8-string >= 0.3 && < 1.1
|
||||
ghc-options: -funbox-strict-fields -Wall -fno-warn-unused-do-bind
|
||||
ghc-options: -funbox-strict-fields -Wall -fno-warn-unused-do-bind -Wno-unused-imports
|
||||
|
||||
-- Keep this in sync with the oldest version in 'tested-with'
|
||||
if impl(ghc <= 8.4.4)
|
||||
ghc-options: -Werror=unused-imports
|
||||
|
||||
if flag(testing)
|
||||
buildable: False
|
||||
@@ -92,7 +96,11 @@ library
|
||||
executable xmonad
|
||||
main-is: Main.hs
|
||||
build-depends: base, X11, mtl, unix, xmonad
|
||||
ghc-options: -Wall -fno-warn-unused-do-bind
|
||||
ghc-options: -Wall -fno-warn-unused-do-bind -Wno-unused-imports
|
||||
|
||||
-- Keep this in sync with the oldest version in 'tested-with'
|
||||
if impl(ghc <= 8.4.4)
|
||||
ghc-options: -Werror=unused-imports
|
||||
|
||||
executable generatemanpage
|
||||
main-is: GenerateManpage.hs
|
||||
|
Reference in New Issue
Block a user