Skip to content
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

Merged
merged 5 commits into from
Apr 17, 2019
Merged

Fix for #1791 #2345

merged 5 commits into from
Apr 17, 2019

Conversation

GambolingPangolin
Copy link
Contributor

@GambolingPangolin GambolingPangolin commented Mar 9, 2019

Fixes #1791

This PR implements a suggestion by @w0rp to recraft the invocations of cabal and stack with BufferCdString.

implements suggestion by @w0rp to set the working directory to avoid
incorrect warnings about missing local imports
@GambolingPangolin
Copy link
Contributor Author

I need some help here passing the CI. On my system ./run-tests [--vim-80-only|--vim-81-only|--neovim-only] all pass at commit 1393845. Advice is very welcome!

Copy link
Member

@w0rp w0rp left a 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'
Copy link
Member

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.

" Author: Eric Wolf <[email protected]>
" Description: ghc for Haskell files called with cabal exec

call ale#Set('haskell_cabal_ghc_options', '-fno-code -v0')
Copy link
Member

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)

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.

Copy link
Contributor Author

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',
Copy link
Member

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.

@w0rp w0rp merged commit 2eb68f6 into dense-analysis:master Apr 17, 2019
@w0rp
Copy link
Member

w0rp commented Apr 17, 2019

Cheers! 🍻

ulidtko added a commit to ulidtko/versioned-configs that referenced this pull request Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack-ghc linter produces errors when it shouldn't
3 participants