haskellhlint

Make HLint ignore parse error due to multi-way if?


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!


Solution

  • 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.