Closed jonascarpay closed 5 years ago
Maybe it's also worth defaulting the lint command to hlint --color
Sounds like a reasonable idea. I'm worried about spaces in file names that we are passing - but maybe any work to quote them is more hassle than it's worth?
I suspect we should pass --colour to HLint only if ghcid detects it should use colour.
I'm worried about spaces in file names that we are passing
That's a good point, although I should be able to reuse this, I think: https://github.com/ndmitchell/ghcid/blob/master/src/Ghcid.hs#L162-L166
I suspect we should pass --colour to HLint only if ghcid detects it should use colour.
That may be a good idea, although it does mean that we make some special allowances for hlint
more than it just being the default linter. I'll leave it for now.
Yep, reusing that escaping code makes a lot of sense.
Also makes sense to leave the HLint without colour. To be honest, syntax highlighting of Haskell expressions with colour in HLint seems odd when GHC highlights the bits of the message but not the code. I wonder if HLint colour wants revisiting.
Alright, I rewrote & confirmed this now works with paths that contain spaces.
Thanks!
Lint commands cannot take arguments since it's the argument to
readProcess
, and therefore needs to exactly name an executable. For instance,ghcid --lint="hlint --color"
crashes, and this fixes that. That said, I'm not entirely sure if there are any nuances that I might be overlooking that make this a bad idea?