Skip to content

Commit

Permalink
tests: Add test case for hlint
Browse files Browse the repository at this point in the history
  • Loading branch information
mohkale committed Apr 10, 2022
1 parent eb8a7eb commit 7043473
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/checkers/flymake-collection-hlint.el
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"A Haskell syntax and style checker using hlint.
See URL `https://github.com/ndmitchell/hlint'."
:title "hlint"
:pre-let ((hlint-exec (executable-find "hlint")))
:pre-check (unless hlint-exec
(error "Cannot find hlint executable"))
Expand Down
1 change: 1 addition & 0 deletions tests/checkers/installers/hlint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apt-get install -y hlint
52 changes: 52 additions & 0 deletions tests/checkers/test-cases/hlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
checker: flymake-collection-hlint
tests:
- name: no-lints
file: |
nolint f g = f . g
lints: []
- name: suggestions-and-warnings
file: |
module Test where
-- Suggestion
suggestion f g = (f . g)
-- Warning
warning f g = f (\x y -> g x y)
lints:
- point: [4, 17]
level: note
message: |-
Redundant bracket
Found:
(f . g)
Perhaps:
f . g
- point: [7, 17]
level: warning
message: |-
Avoid lambda
Found:
\ x y -> g x y
Perhaps:
g
- name: no-lints
file: |
module Test where
-- Suggestion/Warning
suggestion f g = (f . g)
warning f g = f (\x y -> g x y)
-- Error
error f = f (
lints:
- point: [8, 0]
level: error
message: |-
Parse error
Found:
-- Error
error f = f (
>

0 comments on commit 7043473

Please sign in to comment.