diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 9711710..17b1010 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -136,6 +136,8 @@ jobs: echo "package xmonad" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local cat cabal.project diff --git a/.github/workflows/stack.yml b/.github/workflows/stack.yml index 92ea55d..ffc27ab 100644 --- a/.github/workflows/stack.yml +++ b/.github/workflows/stack.yml @@ -65,4 +65,5 @@ jobs: set -ex stack test \ --fast --no-terminal \ - --resolver=${{ matrix.resolver }} --system-ghc + --resolver=${{ matrix.resolver }} --system-ghc \ + --flag=xmonad:pedantic diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 83841b0..1a3ca58 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -1 +1,5 @@ apt: libx11-dev libxext-dev libxinerama-dev libxrandr-dev libxss-dev + +raw-project + package xmonad + flags: +pedantic diff --git a/xmonad.cabal b/xmonad.cabal index 2a460fd..dba5e5e 100644 --- a/xmonad.cabal +++ b/xmonad.cabal @@ -51,6 +51,11 @@ source-repository head type: git location: https://github.com/xmonad/xmonad +flag pedantic + description: Be pedantic (-Werror and the like) + default: False + manual: True + flag generatemanpage default: False manual: True @@ -78,20 +83,26 @@ library , setlocale , unix , utf8-string >= 0.3 && < 1.1 - ghc-options: -funbox-strict-fields -Wall -fno-warn-unused-do-bind -Wno-unused-imports + ghc-options: -funbox-strict-fields -Wall -fno-warn-unused-do-bind -- Keep this in sync with the oldest version in 'tested-with' - if impl(ghc <= 8.4.4) - ghc-options: -Werror=unused-imports + if impl(ghc > 8.4.4) + ghc-options: -Wno-unused-imports + + if flag(pedantic) + ghc-options: -Werror executable xmonad main-is: Main.hs build-depends: base, X11, mtl, unix, xmonad - ghc-options: -Wall -fno-warn-unused-do-bind -Wno-unused-imports + ghc-options: -Wall -fno-warn-unused-do-bind -- Keep this in sync with the oldest version in 'tested-with' - if impl(ghc <= 8.4.4) - ghc-options: -Werror=unused-imports + if impl(ghc > 8.4.4) + ghc-options: -Wno-unused-imports + + if flag(pedantic) + ghc-options: -Werror executable generatemanpage main-is: GenerateManpage.hs @@ -124,3 +135,6 @@ test-suite properties Utils hs-source-dirs: tests build-depends: base, QuickCheck >= 2, X11, containers, xmonad + + if flag(pedantic) + ghc-options: -Werror