summaryrefslogtreecommitdiff
path: root/ale_linters/python
diff options
context:
space:
mode:
authorMarius Gedminas <marius@gedmin.as>2016-11-14 19:52:31 +0200
committerw0rp <w0rp@users.noreply.github.com>2016-11-14 17:52:31 +0000
commit713a6910d40466c34ec5622770c6b7a6cae1d007 (patch)
tree30de2cd68288396779ab71b699312df2c8283b63 /ale_linters/python
parent498a9435dec6c0f9f945bcada3e6409ab9e81a7b (diff)
downloadale-713a6910d40466c34ec5622770c6b7a6cae1d007.zip
Add g:ale_python_flake8_executable (#174)
* Add g:ale_python_flake8_executable Closes #172. * Add g:ale_python_flake8_args * Always add - to flake8 invocations
Diffstat (limited to 'ale_linters/python')
-rw-r--r--ale_linters/python/flake8.vim19
1 files changed, 17 insertions, 2 deletions
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index abee9691..5b011548 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -1,9 +1,24 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: flake8 for python files
+let g:ale_python_flake8_executable =
+\ get(g:, 'ale_python_flake8_executable', 'flake8')
+
+let g:ale_python_flake8_args =
+\ get(g:, 'ale_python_flake8_args', '')
+
+function! ale_linters#python#flake8#GetExecutable(buffer) abort
+ return g:ale_python_flake8_executable
+endfunction
+
+function! ale_linters#python#flake8#GetCommand(buffer) abort
+ return ale_linters#python#flake8#GetExecutable(a:buffer)
+ \ . ' ' . g:ale_python_flake8_args . ' -'
+endfunction
+
call ale#linter#Define('python', {
\ 'name': 'flake8',
-\ 'executable': 'flake8',
-\ 'command': 'flake8 -',
+\ 'executable_callback': 'ale_linters#python#flake8#GetExecutable',
+\ 'command_callback': 'ale_linters#python#flake8#GetCommand',
\ 'callback': 'ale#handlers#HandlePEP8Format',
\})