summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2020-08-31 09:12:36 +0100
committerw0rp <devw0rp@gmail.com>2020-08-31 09:12:36 +0100
commitac2100d410378906d7d277561f50ae3305b6429e (patch)
tree63b0892541173721c1c1e732befa11bdd1458cc6 /test/command_callback
parentcdaeca452e7fe24b117ac840b392fe4e89acda57 (diff)
downloadale-ac2100d410378906d7d277561f50ae3305b6429e.zip
Fix flake8 cd logic for invalid options
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_flake8_command_callback.vader20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/command_callback/test_flake8_command_callback.vader b/test/command_callback/test_flake8_command_callback.vader
index 0f370983..09f64ee3 100644
--- a/test/command_callback/test_flake8_command_callback.vader
+++ b/test/command_callback/test_flake8_command_callback.vader
@@ -41,6 +41,19 @@ Execute(The option for disabling changing directories should work):
\ ale#Escape('flake8') . ' --format=default --stdin-display-name %s -',
\]
+ let g:ale_python_flake8_change_directory = 0
+
+ AssertLinter 'flake8', [
+ \ ale#Escape('flake8') . ' --format=default --stdin-display-name %s -',
+ \]
+
+ " Invalid options should be considered the same as turning the setting off.
+ let g:ale_python_flake8_change_directory = 'xxx'
+
+ AssertLinter 'flake8', [
+ \ ale#Escape('flake8') . ' --format=default --stdin-display-name %s -',
+ \]
+
Execute(The option for changing directory to project root should work):
silent execute 'file ' . fnameescape(g:dir . '/python_paths/namespace_package_tox/namespace/foo/bar.py')
@@ -60,6 +73,13 @@ Execute(The option for changing directory to file dir should work):
\ . ale#Escape('flake8') . ' --format=default --stdin-display-name %s -',
\]
+ let g:ale_python_flake8_change_directory = 1
+
+ AssertLinter 'flake8', [
+ \ ale#path#BufferCdString(bufnr(''))
+ \ . ale#Escape('flake8') . ' --format=default --stdin-display-name %s -',
+ \]
+
Execute(The flake8 command callback should let you set options):
let g:ale_python_flake8_options = '--some-option'