mirror of https://github.com/dense-analysis/ale
#1791 Set the working directory for cabal and stack
This commit is contained in:
parent
104980e40b
commit
2eb68f6d23
|
@ -4,7 +4,8 @@
|
|||
call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0')
|
||||
|
||||
function! ale_linters#haskell#cabal_ghc#GetCommand(buffer) abort
|
||||
return 'cabal exec -- ghc '
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . 'cabal exec -- ghc '
|
||||
\ . ale#Var(a:buffer, 'haskell_cabal_ghc_options')
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
call ale#Set('haskell_stack_ghc_options', '-fno-code -v0')
|
||||
|
||||
function! ale_linters#haskell#stack_ghc#GetCommand(buffer) abort
|
||||
return ale#handlers#haskell#GetStackExecutable(a:buffer)
|
||||
return ale#path#BufferCdString(a:buffer)
|
||||
\ . ale#handlers#haskell#GetStackExecutable(a:buffer)
|
||||
\ . ' ghc -- '
|
||||
\ . ale#Var(a:buffer, 'haskell_stack_ghc_options')
|
||||
\ . ' %t'
|
||||
|
|
|
@ -13,11 +13,11 @@ After:
|
|||
|
||||
Execute(The options should be used in the command):
|
||||
AssertEqual
|
||||
\ 'cabal exec -- ghc -fno-code -v0 %t',
|
||||
\ ale#path#BufferCdString(bufnr('')) . 'cabal exec -- ghc -fno-code -v0 %t',
|
||||
\ ale_linters#haskell#cabal_ghc#GetCommand(bufnr(''))
|
||||
|
||||
let b:ale_haskell_cabal_ghc_options = 'foobar'
|
||||
|
||||
AssertEqual
|
||||
\ 'cabal exec -- ghc foobar %t',
|
||||
\ ale#path#BufferCdString(bufnr('')) . 'cabal exec -- ghc foobar %t',
|
||||
\ ale_linters#haskell#cabal_ghc#GetCommand(bufnr(''))
|
||||
|
|
|
@ -10,8 +10,8 @@ Execute(The linter should not be executed when there's no stack.yaml file):
|
|||
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'
|
||||
AssertLinter 'stack', ale#path#BufferCdString(bufnr('')) . 'stack ghc -- -fno-code -v0 %t'
|
||||
|
||||
let b:ale_haskell_stack_ghc_options = 'foobar'
|
||||
|
||||
AssertLinter 'stack', 'stack ghc -- foobar %t'
|
||||
AssertLinter 'stack', ale#path#BufferCdString(bufnr('')) . 'stack ghc -- foobar %t'
|
||||
|
|
Loading…
Reference in New Issue