mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 20:54:26 +08:00
#540 Fix shell escaping pretty much everywhere
This commit is contained in:
@@ -22,26 +22,26 @@ Execute(The flake8 callbacks should return the correct default values):
|
||||
\ 'flake8',
|
||||
\ ale_linters#python#flake8#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'flake8 --version',
|
||||
\ '''flake8'' --version',
|
||||
\ ale_linters#python#flake8#VersionCheck(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'flake8 --stdin-display-name %s -',
|
||||
\ '''flake8'' --stdin-display-name %s -',
|
||||
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
|
||||
" Try with older versions.
|
||||
call ale_linters#python#flake8#ClearVersionCache()
|
||||
AssertEqual
|
||||
\ 'flake8 -',
|
||||
\ '''flake8'' -',
|
||||
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
|
||||
|
||||
Execute(The flake8 command callback should let you set options):
|
||||
let g:ale_python_flake8_options = '--some-option'
|
||||
|
||||
AssertEqual
|
||||
\ 'flake8 --some-option --stdin-display-name %s -',
|
||||
\ '''flake8'' --some-option --stdin-display-name %s -',
|
||||
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.4'])
|
||||
call ale_linters#python#flake8#ClearVersionCache()
|
||||
AssertEqual
|
||||
\ 'flake8 --some-option -',
|
||||
\ '''flake8'' --some-option -',
|
||||
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
|
||||
|
||||
Execute(You should be able to set a custom executable and it should be escaped):
|
||||
@@ -51,10 +51,10 @@ Execute(You should be able to set a custom executable and it should be escaped):
|
||||
\ 'executable with spaces',
|
||||
\ ale_linters#python#flake8#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'executable\ with\ spaces --version',
|
||||
\ '''executable with spaces'' --version',
|
||||
\ ale_linters#python#flake8#VersionCheck(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'executable\ with\ spaces --stdin-display-name %s -',
|
||||
\ '''executable with spaces'' --stdin-display-name %s -',
|
||||
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
|
||||
|
||||
Execute(The flake8 callbacks should detect virtualenv directories):
|
||||
@@ -64,10 +64,10 @@ Execute(The flake8 callbacks should detect virtualenv directories):
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/bin/flake8',
|
||||
\ ale_linters#python#flake8#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/bin/flake8 --version',
|
||||
\ '''' . g:dir . '/python_paths/with_virtualenv/env/bin/flake8'' --version',
|
||||
\ ale_linters#python#flake8#VersionCheck(bufnr(''))
|
||||
AssertEqual
|
||||
\ g:dir . '/python_paths/with_virtualenv/env/bin/flake8'
|
||||
\ '''' . g:dir . '/python_paths/with_virtualenv/env/bin/flake8'''
|
||||
\ . ' --stdin-display-name %s -',
|
||||
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
|
||||
|
||||
@@ -82,10 +82,10 @@ Execute(Using `python -m flake8` should be supported for running flake8):
|
||||
\ 'python',
|
||||
\ ale_linters#python#flake8#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'python -m flake8 --version',
|
||||
\ '''python'' -m flake8 --version',
|
||||
\ ale_linters#python#flake8#VersionCheck(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'python -m flake8 --some-option -',
|
||||
\ '''python'' -m flake8 --some-option -',
|
||||
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
|
||||
|
||||
call ale_linters#python#flake8#ClearVersionCache()
|
||||
@@ -97,8 +97,8 @@ Execute(Using `python -m flake8` should be supported for running flake8):
|
||||
\ 'python',
|
||||
\ ale_linters#python#flake8#GetExecutable(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'python -m flake8 --version',
|
||||
\ '''python'' -m flake8 --version',
|
||||
\ ale_linters#python#flake8#VersionCheck(bufnr(''))
|
||||
AssertEqual
|
||||
\ 'python -m flake8 --some-option -',
|
||||
\ '''python'' -m flake8 --some-option -',
|
||||
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
|
||||
|
||||
Reference in New Issue
Block a user