8

I'm using the MultiWayIf language extension. While I love HLint (I'm using version v1.8.61), unfortunately it appears that HLint is not aware of this extension, and it reports multi-way ifs as parse errors: Warning: Parse error: |

The HLint Manual (http://community.haskell.org/~ndm/darcs/hlint/hlint.htm) describes how you can use pragmas to indicate suggestions to ignore; however, this doesn't seem to work for warnings due to parse errors.

Is there any way to tell HLint to ignore the parse error warnings? Thank you!

the-konapie
  • 523
  • 2
  • 10
  • 3
    What version of haskell-src-exts is it linked with? The changelog for HSE says it added support for MultiWayIf in 1.15. – Daniel Wagner May 18 '14 at 20:49

1 Answers1

7

You can run:

hlint "--ignore=Parse error" MyFile.hs

There is a test that this invocation works in the HLint test suite.

Note that as soon as there is a parse error you won't get any other hints from the file, since HLint can't operate on a file until it is parsed.

However, if you upgrade to haskell-src-exts-1.15 or higher then reinstall HLint it should parse multi-way-if fine. If not, please report a bug.

Neil Mitchell
  • 8,573
  • 1
  • 24
  • 76
  • 2
    Upgrading `haskell-src-exts` and reinstalling HLint (`cabal install --reinstall hlint`) worked for me. Thank you very much! – the-konapie May 19 '14 at 15:03