summaryrefslogtreecommitdiff
path: root/ale_linters/python
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-05-28 16:34:54 +0100
committerw0rp <devw0rp@gmail.com>2018-05-28 16:34:54 +0100
commit8a659b7cc6ca1c9e7fc7c0d14541d1e12563b83b (patch)
tree04d5167647f849c98354d2500c2e304653673722 /ale_linters/python
parentd9717147bf735a37adc20f1e8a068806f9ba56be (diff)
downloadale-8a659b7cc6ca1c9e7fc7c0d14541d1e12563b83b.zip
Fix #1566 - Add g:ale_python_flake8_change_directory
Diffstat (limited to 'ale_linters/python')
-rw-r--r--ale_linters/python/flake8.vim15
1 files changed, 8 insertions, 7 deletions
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index 4ed41935..9d314d85 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -1,14 +1,13 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: flake8 for python files
-let g:ale_python_flake8_executable =
-\ get(g:, 'ale_python_flake8_executable', 'flake8')
-
" Support an old setting as a fallback.
let s:default_options = get(g:, 'ale_python_flake8_args', '')
-let g:ale_python_flake8_options =
-\ get(g:, 'ale_python_flake8_options', s:default_options)
-let g:ale_python_flake8_use_global = get(g:, 'ale_python_flake8_use_global', get(g:, 'ale_use_global_executables', 0))
+
+call ale#Set('python_flake8_executable', 'flake8')
+call ale#Set('python_flake8_options', s:default_options)
+call ale#Set('python_flake8_use_global', get(g:, 'ale_use_global_executables', 0))
+call ale#Set('python_flake8_change_directory', 1)
function! s:UsingModule(buffer) abort
return ale#Var(a:buffer, 'python_flake8_options') =~# ' *-m flake8'
@@ -39,7 +38,9 @@ function! ale_linters#python#flake8#VersionCheck(buffer) abort
endfunction
function! ale_linters#python#flake8#GetCommand(buffer, version_output) abort
- let l:cd_string = ale#path#BufferCdString(a:buffer)
+ let l:cd_string = ale#Var(a:buffer, 'python_flake8_change_directory')
+ \ ? ale#path#BufferCdString(a:buffer)
+ \ : ''
let l:executable = ale_linters#python#flake8#GetExecutable(a:buffer)
let l:version = ale#semver#GetVersion(l:executable, a:version_output)