Fix -Wall and -Wunused-packages in fourmolu and ormolu plugins (#4007)

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
This commit is contained in:
Jan Hrcek 2024-01-23 12:36:05 +01:00 committed by GitHub
parent 3fa2f7c69b
commit d6553e001f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 17 deletions

View File

@ -22,16 +22,18 @@ source-repository head
type: git
location: git://github.com/haskell/haskell-language-server.git
common warnings
ghc-options: -Wall -Wunused-packages
library
import: warnings
exposed-modules:
Ide.Plugin.Fourmolu
hs-source-dirs: src
ghc-options: -Wall
build-depends:
, base >=4.12 && <5
, filepath
, fourmolu ^>= 0.14
, ghc
, ghc-boot-th
, ghcide == 2.6.0.0
, hls-plugin-api == 2.6.0.0
@ -45,17 +47,17 @@ library
default-language: Haskell2010
test-suite tests
import: warnings
type: exitcode-stdio-1.0
default-language: Haskell2010
hs-source-dirs: test
main-is: Main.hs
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-tool-depends:
fourmolu:fourmolu
build-depends:
, base >=4.12 && <5
, aeson
, containers
, filepath
, hls-fourmolu-plugin
, hls-plugin-api

View File

@ -22,18 +22,20 @@ source-repository head
type: git
location: https://github.com/haskell/haskell-language-server.git
common warnings
ghc-options: -Wall -Wunused-packages
library
import: warnings
exposed-modules: Ide.Plugin.Ormolu
hs-source-dirs: src
build-depends:
, base >=4.12 && <5
, extra
, filepath
, ghc
, ghc-boot-th
, ghcide == 2.6.0.0
, hls-plugin-api == 2.6.0.0
, lens
, lsp
, mtl
, process-extras >= 0.7.1
@ -44,6 +46,7 @@ library
default-language: Haskell2010
test-suite tests
import: warnings
type: exitcode-stdio-1.0
default-language: Haskell2010
hs-source-dirs: test
@ -54,11 +57,9 @@ test-suite tests
build-depends:
, base
, aeson
, containers
, filepath
, hls-ormolu-plugin
, hls-plugin-api
, hls-test-utils == 2.6.0.0
, lsp-types
, text
, ormolu

View File

@ -16,13 +16,10 @@ where
import Control.Exception (Handler (..), IOException,
SomeException (..), catches,
handle)
import Control.Monad.Except (ExceptT (ExceptT), runExceptT,
throwError)
import Control.Monad.Except (runExceptT, throwError)
import Control.Monad.Extra
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Trans
import Control.Monad.Trans.Except (ExceptT (..), mapExceptT,
runExceptT)
import Control.Monad.Trans.Except (ExceptT (..), mapExceptT)
import Data.Functor ((<&>))
import Data.List (intercalate)
import Data.Maybe (catMaybes)
@ -38,7 +35,6 @@ import Ide.Plugin.Properties
import Ide.PluginUtils
import Ide.Types hiding (Config)
import qualified Ide.Types as Types
import Language.LSP.Protocol.Message
import Language.LSP.Protocol.Types
import Language.LSP.Server hiding (defaultConfig)
import Ormolu

View File

@ -5,8 +5,8 @@ module Main
) where
import Data.Aeson
import qualified Data.Aeson.KeyMap as KM
import Data.Functor
import qualified Data.Text as T
import Ide.Plugin.Config
import qualified Ide.Plugin.Ormolu as Ormolu
import Language.LSP.Protocol.Types
@ -34,9 +34,10 @@ tests = testGroup "ormolu" $
]
goldenWithOrmolu :: Bool -> TestName -> FilePath -> FilePath -> (TextDocumentIdentifier -> Session ()) -> TestTree
goldenWithOrmolu cli title path desc = goldenWithHaskellDocFormatter def ormoluPlugin "ormolu" def title testDataDir path desc "hs"
goldenWithOrmolu cli title path desc =
goldenWithHaskellDocFormatter def ormoluPlugin "ormolu" conf title testDataDir path desc "hs"
where
conf = def{plcConfig = (\(Object obj) -> obj) $ object ["external" .= cli]}
conf = def{plcConfig = KM.fromList ["external" .= cli]}
testDataDir :: FilePath
testDataDir = "test" </> "testdata"