Skip to content

Commit d01aefd

Browse files
committed
Less noisy workaround
1 parent 47a9dcd commit d01aefd

File tree

1 file changed

+8
-28
lines changed

1 file changed

+8
-28
lines changed

haskell-language-server.cabal

+8-28
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ common test-defaults
4646
common warnings
4747
ghc-options: -Wall
4848
-Wredundant-constraints
49-
-- Note [unused-packages] Some packages need CPP conditioned on MIN_VERSION_ghc(x,y,z).
50-
-- MIN_VERSION_<pkg> is CPP macro that cabal defines only when <pkg> is declared as a dependency.
51-
-- But -Wunused-packages still reports it as unused dependency if it's not imported.
52-
-- For packages with such "unused" dependencies we demote -Wunused-packages error
53-
-- (enabled by --flag=pedantic) to warning via -Wwarn=unused-packages.
5449
-Wunused-packages
5550
-Wno-name-shadowing
5651
-Wno-unticked-promoted-constructors
@@ -63,7 +58,14 @@ flag pedantic
6358
-- Allow compiling in pedantic mode
6459
common pedantic
6560
if flag(pedantic)
66-
ghc-options: -Werror
61+
ghc-options:
62+
-Werror
63+
-- Note [unused-packages] Some packages need CPP conditioned on MIN_VERSION_ghc(x,y,z).
64+
-- MIN_VERSION_<pkg> is CPP macro that cabal defines only when <pkg> is declared as a dependency.
65+
-- But -Wunused-packages still reports it as unused dependency if it's not imported.
66+
-- For packages with such "unused" dependencies we demote -Wunused-packages error
67+
-- (enabled by --flag=pedantic) to warning via -Wwarn=unused-packages.
68+
-Wwarn=unused-packages
6769

6870
-- Plugin flags are designed for 'cabal install haskell-language-server':
6971
-- - Bulk flags should be default:False
@@ -430,10 +432,6 @@ library hls-explicit-imports-plugin
430432
import: defaults, pedantic, warnings
431433
exposed-modules: Ide.Plugin.ExplicitImports
432434
hs-source-dirs: plugins/hls-explicit-imports-plugin/src
433-
if flag(pedantic)
434-
ghc-options:
435-
--See Note [unused-packages]
436-
-Wwarn=unused-packages
437435
build-depends:
438436
, aeson
439437
, base >=4.12 && <5
@@ -814,10 +812,6 @@ library hls-splice-plugin
814812
exposed-modules:
815813
Ide.Plugin.Splice
816814
Ide.Plugin.Splice.Types
817-
if flag(pedantic)
818-
ghc-options:
819-
--See Note [unused-packages]
820-
-Wwarn=unused-packages
821815

822816
hs-source-dirs: plugins/hls-splice-plugin/src
823817
build-depends:
@@ -1378,10 +1372,6 @@ test-suite hls-ormolu-plugin-tests
13781372
type: exitcode-stdio-1.0
13791373
hs-source-dirs: plugins/hls-ormolu-plugin/test
13801374
main-is: Main.hs
1381-
if flag(pedantic)
1382-
ghc-options:
1383-
--See Note [unused-packages]
1384-
-Wwarn=unused-packages
13851375
build-tool-depends:
13861376
ormolu:ormolu
13871377
build-depends:
@@ -1680,11 +1670,6 @@ library
16801670

16811671
default-extensions: DataKinds
16821672

1683-
if flag(pedantic)
1684-
ghc-options:
1685-
--See Note [unused-packages]
1686-
-Wwarn=unused-packages
1687-
16881673
executable haskell-language-server
16891674
import: defaults
16901675
, warnings
@@ -1804,11 +1789,6 @@ test-suite func-test
18041789
Test.Hls.Command
18051790
Test.Hls.Flags
18061791

1807-
if flag(pedantic)
1808-
ghc-options:
1809-
--See Note [unused-packages]
1810-
-Wwarn=unused-packages
1811-
18121792
default-extensions: OverloadedStrings
18131793

18141794
-- Duplicating inclusion plugin conditions until tests are moved to their own packages

0 commit comments

Comments
 (0)