haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 211 forks source link

How to control linters? #635

Closed hasufell closed 6 years ago

hasufell commented 6 years ago

I haven't found a way to completely disable hlint. I find most of its suggestions either outright wrong (it suggests changing semantics) or just annoying. So I don't want to use a .hlint.yaml for every single project.

hie --help doesn't show anything useful either.

It should somehow be possible to control the behavior of the linters, which are shown here.

alanz commented 6 years ago

Which IDE/client are you using? There is a configuration setting to turn off hlint, but it is only exposed in vscode at the moment, as far as I know.

hasufell commented 6 years ago

https://github.com/autozimu/LanguageClient-neovim

lukel97 commented 6 years ago

For languageclient-neovim add

{
    "languageServerHaskell": {
        "hlintOn": false
    }
}

to .vim/settings.json in your project root

hasufell commented 6 years ago

Can this be done globally?

Anrock commented 6 years ago

@hasufell yeah, set g:LanguageClient_settingsPath to some absolute path @Bubba are those settings documented somewhere?

hasufell commented 6 years ago

That configuration option is just for hlint though. What about the others?

alanz commented 6 years ago

There are no others. The config is currently defined as

data Config =
  Config
    { hlintOn             :: Bool
    , maxNumberOfProblems :: Int
    } deriving (Show)

in https://github.com/haskell/haskell-ide-engine/blob/master/src/Haskell/Ide/Engine/Transport/LspStdio.hs#L158

Note that maxNumberOfProblems applies across all sources of diagnostics, including GHC.