New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept suggestions from haskell-lint as 'info' #874

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@corngood
Contributor

corngood commented Feb 14, 2016

In hint-1.9.28 a bunch of warnings were changed to 'suggestions'. Without this change any suggestion will result in:

Suspicious state from syntax checker haskell-hlint: Checker haskell-hlint returned non-zero exit code 1, but no errors from output:

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Feb 15, 2016

@corngood Thank you. Would you mind to take a look at the hlint test cases in test/flycheck-test.el whether they need to be updated?

@corngood

This comment has been minimized.

Contributor

corngood commented Feb 15, 2016

Yeah, the test cases will probably need to be updated for hlint-1.9.28, with or without my change.

I got the tests running locally as per .travis.yml, but this doesn't seem to include the hlint tests. Can you point me in the right direction? The testing system is very complex, and I already had to install bundler, cask, etc, to get the travis tests working.

@corngood

This comment has been minimized.

Contributor

corngood commented Feb 15, 2016

Also, any thoughts on how the tests should work when the results depend on hlint version? Just update the tests to pass with the latest version?

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Feb 15, 2016

@corngood We don't require bundler anymore ☺️

I'm sorry that you went through this hassle; our new contributing guide should redeem some of this.

Just update the test to the latest version; then use test/run.el '(language haskell) to run all Haskell tests.

Update haskell tests for hlint 1.9.28
All tests now pass with:

The Glorious Glasgow Haskell Compilation System, version 7.10.3
HLint v1.9.28, (C) Neil Mitchell 2006-2016
ghc-mod version 5.5.0.0 compiled by GHC 7.10.3
@corngood

This comment has been minimized.

Contributor

corngood commented Feb 15, 2016

Ok, I got the haskell tests running. I did it with:

emacs --script test/run.el -f flycheck-run-tests-main "(language haskell)"

Which might be worth noting specifically in the docs, unless there's a better way?

I updated the tests and they all pass with:

The Glorious Glasgow Haskell Compilation System, version 7.10.3
HLint v1.9.28, (C) Neil Mitchell 2006-2016
ghc-mod version 5.5.0.0 compiled by GHC 7.10.3

Compiler is from stackage lts-5.3, so it's probably the best version for today. The others are latest releases.

I also tested with ghc 8 rc2 and there were some failures from what looks like regressions in ghc. I'll test it again on release. For future reference:

Test flycheck-define-checker/haskell-ghc/literate condition:
    (ert-test-failed
     ((should
       (equal expected flycheck-current-errors))
      :form
      (equal
       ([cl-struct-flycheck-error #<killed buffer> haskell-ghc "/home/david/git/flycheck/test/resources/language/haskell/Literate.lhs" 6 1 "Top-level binding with no type signature: foo :: forall t. t" warning nil])
       ([cl-struct-flycheck-error #<killed buffer> haskell-ghc "/home/david/git/flycheck/test/resources/language/haskell/Literate.lhs" 6 1 "Top-level binding with no type signature: foo :: forall a. a" warning nil]))
      :value nil :explanation
      (list-elt 0
                (array-elt 6
                           (array-elt 56 ...)))))

Test flycheck-define-checker/haskell-ghc/syntax-error condition:
    (ert-test-failed
     ((should
       (equal expected flycheck-current-errors))
      :form
      (equal
       ([cl-struct-flycheck-error #<killed buffer> haskell-ghc "/home/david/git/flycheck/test/resources/language/haskell/SyntaxError.hs" 3 1 "parse error on input ‘module’" error nil])
       ([cl-struct-flycheck-error #<killed buffer> haskell-ghc "/home/david/git/flycheck/test/resources/language/haskell/SyntaxError.hs" 3 1 "error:" error nil]))
      :value nil :explanation
      (list-elt 0
                (array-elt 6
                           (arrays-of-different-length 29 6 "parse error on input ‘module’" "error:" first-mismatch-at 0)))))

Test flycheck-define-checker/haskell-ghc/type-error condition:
    (ert-test-failed
     ((should
       (equal expected flycheck-current-errors))
      :form
      (equal
       ([cl-struct-flycheck-error #<killed buffer> haskell-ghc "/home/david/git/flycheck/test/resources/language/haskell/Error.hs" 4 16 "Couldn't match type ‘Bool’ with ‘[Char]’\nExpected type: String\n  Actual type: Bool\nIn the first argument of ‘putStrLn’, namely ‘True’\nIn the expression: putStrLn True" error nil])
       ([cl-struct-flycheck-error #<killed buffer> haskell-ghc "/home/david/git/flycheck/test/resources/language/haskell/Error.hs" 4 16 "error:" error nil]))
      :value nil :explanation
      (list-elt 0
                (array-elt 6
                           (arrays-of-different-length 166 6 "Couldn't match type ‘Bool’ with ‘[Char]’\nExpected type: String\n  Actual type: Bool\nIn the first argument of ‘putStrLn’, namely ‘True’\nIn the expression: putStrLn True" "error:" first-mismatch-at 0)))))
@corngood

This comment has been minimized.

Contributor

corngood commented Feb 15, 2016

Oh, is the flycheck VM still a thing? If so, should I look into updating it?

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Feb 15, 2016

No, thanks, but that's our job if at all 😊

@cpitclaudel

This comment has been minimized.

Member

cpitclaudel commented Feb 16, 2016

Thanks for this patch @corngood! Sorry that I didn't react earlier to this change; I saw the original announcement at http://neilmitchell.blogspot.com/2016/02/new-hlint-version-and-api-features.html, but I didn't get a notification about the answer and it fell off my radar.
It's pretty cool to get help from the community though :)

@lunaryorn

This comment has been minimized.

Contributor

lunaryorn commented Feb 16, 2016

@corngood Thank you very much; I merged your change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment