ci: Enable -Werror

We don't want to ignore warnings do we?
This commit is contained in:
Tomas Janousek 2021-03-29 16:43:58 +01:00
parent 22b579bd14
commit 5cdf428f55
4 changed files with 28 additions and 7 deletions

View File

@ -136,6 +136,8 @@ jobs:
echo "package xmonad" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
package xmonad
flags: +pedantic
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(xmonad)$/; }' >> cabal.project.local
cat cabal.project

View File

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

View File

@ -1 +1,5 @@
apt: libx11-dev libxext-dev libxinerama-dev libxrandr-dev libxss-dev
raw-project
package xmonad
flags: +pedantic

View File

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