branch: elpa/flymake-collection commit 7043473d10834690f1b6974c83193ba7d38a9d65 Author: Mohsin Kaleem <mohk...@kisara.moe> Commit: Mohsin Kaleem <mohk...@kisara.moe>
tests: Add test case for hlint --- src/checkers/flymake-collection-hlint.el | 1 - tests/checkers/installers/hlint.bash | 1 + tests/checkers/test-cases/hlint.yml | 52 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/checkers/flymake-collection-hlint.el b/src/checkers/flymake-collection-hlint.el index d2ae6e1f91..4b715c83f5 100644 --- a/src/checkers/flymake-collection-hlint.el +++ b/src/checkers/flymake-collection-hlint.el @@ -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")) diff --git a/tests/checkers/installers/hlint.bash b/tests/checkers/installers/hlint.bash new file mode 100755 index 0000000000..d1301f1f02 --- /dev/null +++ b/tests/checkers/installers/hlint.bash @@ -0,0 +1 @@ +apt-get install -y hlint diff --git a/tests/checkers/test-cases/hlint.yml b/tests/checkers/test-cases/hlint.yml new file mode 100644 index 0000000000..3ca585c07b --- /dev/null +++ b/tests/checkers/test-cases/hlint.yml @@ -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 ( + >