Skip to content

Commit 29d84e8

Browse files
authored
Enable more warnings for the ghcide codebase (#75)
1 parent 8db311c commit 29d84e8

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

132133
executable 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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module Development.IDE.Types.Diagnostics (
1616
import Data.Maybe as Maybe
1717
import qualified Data.Text as T
1818
import Data.Text.Prettyprint.Doc
19-
import qualified Language.Haskell.LSP.Types as LSP
2019
import Language.Haskell.LSP.Types as LSP (
2120
DiagnosticSeverity(..)
2221
, Diagnostic(..)

test/cabal/Development/IDE/Test/Runfiles.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@ module Development.IDE.Test.Runfiles
55
( locateGhcideExecutable
66
) where
77

8-
import System.FilePath (FilePath)
9-
10-
118
locateGhcideExecutable :: IO FilePath
129
locateGhcideExecutable = pure "ghcide"

test/exe/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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"

0 commit comments

Comments
 (0)