ci: Enable -Werror

Related: 14d9fa247a
Related: 5cdf428f55
This commit is contained in:
Tomas Janousek 2021-05-23 21:01:13 +01:00
parent 43e35952c8
commit cef324795e
4 changed files with 31 additions and 11 deletions

View File

@ -140,6 +140,9 @@ jobs:
type: git
location: https://github.com/xmonad/xmonad
branch: master
package xmonad-contrib
flags: +pedantic
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(xmonad-contrib)$/; }' >> cabal.project.local
cat cabal.project

View File

@ -99,4 +99,5 @@ jobs:
stack test \
--fast --no-terminal \
--stack-yaml=${{ matrix.yaml }} \
--resolver=${{ matrix.resolver }} --system-ghc
--resolver=${{ matrix.resolver }} --system-ghc \
--flag=xmonad-contrib:pedantic

View File

@ -5,3 +5,7 @@ apt:
libxinerama-dev
libxrandr-dev
libxss-dev
raw-project
package xmonad-contrib
flags: +pedantic

View File

@ -41,10 +41,10 @@ source-repository head
flag use_xft
description: Use Xft to render text
flag testing
description: Testing mode
manual: True
default: False
flag pedantic
description: Be pedantic (-Werror and the like)
default: False
manual: True
library
build-depends: base >= 4.9 && < 5,
@ -61,19 +61,21 @@ library
xmonad >= 0.15 && < 0.16,
utf8-string
ghc-options: -fwarn-tabs -Wall -Wno-unused-do-bind -Wno-unused-imports
ghc-options: -Wall -Wno-unused-do-bind
if flag(pedantic)
ghc-options: -Werror -Wwarn=deprecations
-- 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)
-- don't treat unused-imports warning as errors, they may be necessary
-- for compatibility with older versions of base (or other deps)
ghc-options: -Wwarn=unused-imports
if flag(use_xft)
build-depends: X11-xft >= 0.2
cpp-options: -DXFT
if flag(testing)
ghc-options: -fwarn-tabs -Werror
exposed-modules: XMonad.Actions.AfterDrag
XMonad.Actions.BluetileCommands
XMonad.Actions.Commands
@ -417,3 +419,13 @@ test-suite tests
, utf8-string
, xmonad >= 0.15 && < 0.16
cpp-options: -DTESTING
ghc-options: -Wall -Wno-unused-do-bind
if flag(pedantic)
ghc-options: -Werror -Wwarn=deprecations
-- Keep this in sync with the oldest version in 'tested-with'
if impl(ghc > 8.4.4)
-- don't treat unused-imports warning as errors, they may be necessary
-- for compatibility with older versions of base (or other deps)
ghc-options: -Wwarn=unused-imports