diff options
author | Anthony Poon <marquis.andras@gmail.com> | 2018-10-26 01:30:49 +1100 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2018-10-25 15:30:49 +0100 |
commit | 02c0d5bcb9f7d4191a5e069aa0b8cd4065d6c039 (patch) | |
tree | 69211b13e1083789394f376a8a79c1e71c8a31b7 /test/command_callback | |
parent | 9bdd5771ef85ca24aeadab80bb1d0976920e9305 (diff) | |
download | ale-02c0d5bcb9f7d4191a5e069aa0b8cd4065d6c039.zip |
Only run stack if a stack.yaml config is found (#1752)
* Only run stack if a stack.yaml config is found
It is necessary to check for a stack.yaml file to distinguish between
cabal-only projects or stack projects (which are also cabal projects
since stack is built on top of cabal).
* Test that stack is called if stack.yaml exists
Diffstat (limited to 'test/command_callback')
4 files changed, 27 insertions, 0 deletions
diff --git a/test/command_callback/stack_build_paths/stack.yaml b/test/command_callback/stack_build_paths/stack.yaml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/command_callback/stack_build_paths/stack.yaml diff --git a/test/command_callback/stack_ghc_paths/stack.yaml b/test/command_callback/stack_ghc_paths/stack.yaml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/command_callback/stack_ghc_paths/stack.yaml diff --git a/test/command_callback/test_haskell_stack_build_command_callback.vader b/test/command_callback/test_haskell_stack_build_command_callback.vader new file mode 100644 index 00000000..f1e6f755 --- /dev/null +++ b/test/command_callback/test_haskell_stack_build_command_callback.vader @@ -0,0 +1,13 @@ +Before: + call ale#assert#SetUpLinterTest('haskell', 'stack_build') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The linter should not be executed when there's no stack.yaml file): + AssertLinterNotExecuted + +Execute(The linter should be executed when there is a stack.yaml file): + call ale#test#SetFilename('stack_build_paths/test.hs') + + AssertLinter 'stack', 'stack build --fast' diff --git a/test/command_callback/test_haskell_stack_ghc_command_callback.vader b/test/command_callback/test_haskell_stack_ghc_command_callback.vader new file mode 100644 index 00000000..4adab583 --- /dev/null +++ b/test/command_callback/test_haskell_stack_ghc_command_callback.vader @@ -0,0 +1,14 @@ +Before: + call ale#assert#SetUpLinterTest('haskell', 'stack_ghc') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The linter should not be executed when there's no stack.yaml file): + AssertLinterNotExecuted + +Execute(The linter should be executed when there is a stack.yaml file): + call ale#test#SetFilename('stack_ghc_paths/test.hs') + + AssertLinter 'stack', 'stack ghc -- -fno-code -v0 %t' + |