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:
slotThe
2020-12-13 20:57:04 +01:00
parent 3ea0d74954
commit 823581816a

View File

@@ -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