ale/ale_linters/python/flake8.vim
Marius Gedminas 713a6910d4 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
2016-11-14 17:52:31 +00:00

25 lines
787 B
VimL

" 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_callback': 'ale_linters#python#flake8#GetExecutable',
\ 'command_callback': 'ale_linters#python#flake8#GetCommand',
\ 'callback': 'ale#handlers#HandlePEP8Format',
\})