on master help sign in
Enable more warnings for the ghcide codebase (#75)
commit29d84e835bf7429b4880ed449efd9e7f7ac12de0 authorMoritz Kiefer <moritz.kiefer@purelyfunctional.org> dateTue 17 Sep 2019, 08:50 (7 years ago) parent8db311c
5 files changed+8−11
azure-pipelines.yml+3−3 ghcide.cabal+3−2 src/Development/IDE/Types/Diagnostics.hs−1 test/cabal/Development/IDE/Test/Runfiles.hs−3 test/exe/Main.hs+2−2
azure-pipelines.yml+3−3
@@ -39,7 +39,7 @@ jobs:
3939 displayName: 'Install Stack'
4040 - bash: stack setup
4141 displayName: 'stack setup'
42− - bash: stack build --only-dependencies
42+ - bash: stack build --only-dependencies --ghc-options=-Werror
4343 displayName: 'stack build --only-dependencies'
4444 - bash: stack test || stack test || stack test
4545 # ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
@@ -83,7 +83,7 @@ jobs:
8383 displayName: 'Install Stack'
8484 - bash: stack setup --stack-yaml=stack84.yaml
8585 displayName: 'stack setup --stack-yaml=stack84.yaml'
86− - bash: stack build --only-dependencies --stack-yaml=stack84.yaml
86+ - bash: stack build --only-dependencies --stack-yaml=stack84.yaml --ghc-options=-Werror
8787 displayName: 'stack build --only-dependencies --stack-yaml=stack84.yaml'
8888 - bash: stack test --stack-yaml=stack84.yaml || stack test --stack-yaml=stack84.yaml || stack test --stack-yaml=stack84.yaml
8989 # ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
@@ -127,7 +127,7 @@ jobs:
127127 displayName: 'Install Stack'
128128 - bash: stack setup --stack-yaml=stack-ghc-lib.yaml
129129 displayName: 'stack setup --stack-yaml=stack-ghc-lib.yaml'
130− - bash: stack build --only-dependencies --stack-yaml=stack-ghc-lib.yaml
130+ - bash: stack build --only-dependencies --stack-yaml=stack-ghc-lib.yaml --ghc-options=-Werror
131131 displayName: 'stack build --only-dependencies --stack-yaml=stack-ghc-lib.yaml'
132132 - bash: stack test --stack-yaml=stack-ghc-lib.yaml || stack test --stack-yaml=stack-ghc-lib.yaml || stack test --stack-yaml=stack-ghc-lib.yaml
133133 # ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
ghcide.cabal+3−2
@@ -128,13 +128,14 @@ library
128128 Development.IDE.Spans.Calculate
129129 Development.IDE.Spans.Documentation
130130 Development.IDE.Spans.Type
131+ ghc-options: -Wall -Wno-name-shadowing
131132
132133executable ghcide
133134 if flag(ghc-lib)
134135 buildable: False
135136 default-language: Haskell2010
136137 hs-source-dirs: exe
137− ghc-options: -threaded
138+ ghc-options: -threaded -Wall -Wno-name-shadowing
138139 main-is: Main.hs
139140 build-depends:
140141 base == 4.*,
@@ -188,7 +189,7 @@ test-suite ghcide-tests
188189 text
189190 hs-source-dirs: test/cabal test/exe test/src
190191 include-dirs: include
191− ghc-options: -threaded
192+ ghc-options: -threaded -Wall -Wno-name-shadowing
192193 main-is: Main.hs
193194 other-modules:
194195 Development.IDE.Test
src/Development/IDE/Types/Diagnostics.hs−1
@@ -16,7 +16,6 @@ module Development.IDE.Types.Diagnostics (
1616import Data.Maybe as Maybe
1717import qualified Data.Text as T
1818import Data.Text.Prettyprint.Doc
19−import qualified Language.Haskell.LSP.Types as LSP
2019import Language.Haskell.LSP.Types as LSP (
2120 DiagnosticSeverity(..)
2221 , Diagnostic(..)
test/cabal/Development/IDE/Test/Runfiles.hs−3
@@ -5,8 +5,5 @@ module Development.IDE.Test.Runfiles
55 ( locateGhcideExecutable
66 ) where
77
8−import System.FilePath (FilePath)
9−
10−
118locateGhcideExecutable :: IO FilePath
129locateGhcideExecutable = pure "ghcide"
test/exe/Main.hs+2−2
@@ -389,7 +389,7 @@ removeImportTests = testGroup "remove import actions"
389389 let contentA = T.unlines
390390 [ "module ModuleA where"
391391 ]
392− docA <- openDoc' "ModuleA.hs" "haskell" contentA
392+ _docA <- openDoc' "ModuleA.hs" "haskell" contentA
393393 let contentB = T.unlines
394394 [ "{-# OPTIONS_GHC -Wunused-imports #-}"
395395 , "module ModuleB where"
@@ -413,7 +413,7 @@ removeImportTests = testGroup "remove import actions"
413413 let contentA = T.unlines
414414 [ "module ModuleA where"
415415 ]
416− docA <- openDoc' "ModuleA.hs" "haskell" contentA
416+ _docA <- openDoc' "ModuleA.hs" "haskell" contentA
417417 let contentB = T.unlines
418418 [ "{-# OPTIONS_GHC -Wunused-imports #-}"
419419 , "module ModuleB where"