-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix for #1791 #2345
Fix for #1791 #2345
Conversation
I need some help here passing the CI. On my system |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply. I've been either busy or on holiday.
@@ -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', 'cd ''/testplugin/test/command_callback/stack_ghc_paths'' && stack ghc -- -fno-code -v0 %t' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ale#path#BufferCdString(bufnr(''))
in tests instead, and then they should pass on the CI servers.
ale_linters/haskell/cabal_v2_ghc.vim
Outdated
" Author: Eric Wolf <[email protected]> | ||
" Description: ghc for Haskell files called with cabal exec | ||
|
||
call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can cut this file out for now. We could add an executable
option later for switching the cabal linter to cabal_v2_ghc
.
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not fix the issue for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm running Stack 1.9.3 (ghc nopie) on Arch Linux, and at this commit, stack is loading project modules correctly. What is your setup? Also, would it be possible to share an example project where you get the bug?
\ ale_linters#haskell#cabal_ghc#GetCommand(bufnr('')) | ||
|
||
let b:ale_haskell_cabal_ghc_options = 'foobar' | ||
|
||
AssertEqual | ||
\ 'cabal exec -- ghc foobar %t', | ||
\ 'cd ''/testplugin'' && cabal exec -- ghc foobar %t', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can apply BufferCdString
again here to fix this test.
Cheers! 🍻 |
Fixes #1791
This PR implements a suggestion by @w0rp to recraft the invocations of
cabal
andstack
withBufferCdString
.