mirror of
https://github.com/haskell/haskell-language-server.git
synced 2024-09-19 04:37:25 +03:00
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:
parent
3fa2f7c69b
commit
d6553e001f
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user