Default flake8 to --format=default

This commit is contained in:
Matthew Grossman 2017-08-08 21:04:46 -07:00
parent 670858f774
commit fe95fcd357
2 changed files with 9 additions and 8 deletions

View File

@ -80,6 +80,7 @@ function! ale_linters#python#flake8#GetCommand(buffer, version_output) abort
\ : '' \ : ''
let l:options = ale#Var(a:buffer, 'python_flake8_options') let l:options = ale#Var(a:buffer, 'python_flake8_options')
\ . ' --format=default'
return ale#Escape(ale_linters#python#flake8#GetExecutable(a:buffer)) return ale#Escape(ale_linters#python#flake8#GetExecutable(a:buffer))
\ . (!empty(l:options) ? ' ' . l:options : '') \ . (!empty(l:options) ? ' ' . l:options : '')

View File

@ -19,23 +19,23 @@ Execute(The flake8 callbacks should return the correct default values):
\ '''flake8'' --version', \ '''flake8'' --version',
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''flake8'' --stdin-display-name %s -', \ '''flake8'' --format=default --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
" Try with older versions. " Try with older versions.
call ale_linters#python#flake8#ClearVersionCache() call ale_linters#python#flake8#ClearVersionCache()
AssertEqual AssertEqual
\ '''flake8'' -', \ '''flake8'' --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
Execute(The flake8 command callback should let you set options): Execute(The flake8 command callback should let you set options):
let g:ale_python_flake8_options = '--some-option' let g:ale_python_flake8_options = '--some-option'
AssertEqual AssertEqual
\ '''flake8'' --some-option --stdin-display-name %s -', \ '''flake8'' --some-option --format=default --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.4']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.4'])
call ale_linters#python#flake8#ClearVersionCache() call ale_linters#python#flake8#ClearVersionCache()
AssertEqual AssertEqual
\ '''flake8'' --some-option -', \ '''flake8'' --some-option --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
Execute(You should be able to set a custom executable and it should be escaped): Execute(You should be able to set a custom executable and it should be escaped):
@ -48,7 +48,7 @@ Execute(You should be able to set a custom executable and it should be escaped):
\ '''executable with spaces'' --version', \ '''executable with spaces'' --version',
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''executable with spaces'' --stdin-display-name %s -', \ '''executable with spaces'' --format=default --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
Execute(The flake8 callbacks should detect virtualenv directories): Execute(The flake8 callbacks should detect virtualenv directories):
@ -62,7 +62,7 @@ Execute(The flake8 callbacks should detect virtualenv directories):
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''' . g:dir . '/python_paths/with_virtualenv/env/bin/flake8''' \ '''' . g:dir . '/python_paths/with_virtualenv/env/bin/flake8'''
\ . ' --stdin-display-name %s -', \ . ' --format=default --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
Execute(The FindProjectRoot should detect the project root directory for namespace package via Manifest.in): Execute(The FindProjectRoot should detect the project root directory for namespace package via Manifest.in):
@ -114,7 +114,7 @@ Execute(Using `python -m flake8` should be supported for running flake8):
\ '''python'' -m flake8 --version', \ '''python'' -m flake8 --version',
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''python'' -m flake8 --some-option -', \ '''python'' -m flake8 --some-option --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
call ale_linters#python#flake8#ClearVersionCache() call ale_linters#python#flake8#ClearVersionCache()
@ -129,5 +129,5 @@ Execute(Using `python -m flake8` should be supported for running flake8):
\ '''python'' -m flake8 --version', \ '''python'' -m flake8 --version',
\ ale_linters#python#flake8#VersionCheck(bufnr('')) \ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual AssertEqual
\ '''python'' -m flake8 --some-option -', \ '''python'' -m flake8 --some-option --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9']) \ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])