summaryrefslogtreecommitdiff
path: root/test/test_cursor_warnings.vader
diff options
context:
space:
mode:
authorYuto <git@aiotter.com>2020-04-18 19:59:26 +0900
committerGitHub <noreply@github.com>2020-04-18 11:59:26 +0100
commit93a13d73538c05cdf26183bf96be29155e780dd2 (patch)
treeb93801d56577bb913ae49d581b19fb5fdd11bb42 /test/test_cursor_warnings.vader
parent198361bc0da6f13d1ea5f699fc202c981e97b861 (diff)
downloadale-93a13d73538c05cdf26183bf96be29155e780dd2.zip
Broken message in pycodestyle (or any other Linters whose name include 'code') (#3114)
* Swap substitution order for echoed message This prevents 'code' string in liter_name to be substituted by accident. Linters including pycodestyle have been affected by this problem. * Add test for linter whose name contains 'code' Test for c525db8cb4088d02448c5ddcf4a80ffa028c3181
Diffstat (limited to 'test/test_cursor_warnings.vader')
-rw-r--r--test/test_cursor_warnings.vader19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test_cursor_warnings.vader b/test/test_cursor_warnings.vader
index 2a6156f0..6156fd65 100644
--- a/test/test_cursor_warnings.vader
+++ b/test/test_cursor_warnings.vader
@@ -75,6 +75,17 @@ Before:
\ 'type': 'E',
\ 'text': 'lowercase error',
\ },
+ \ {
+ \ 'lnum': 3,
+ \ 'col': 5,
+ \ 'bufnr': bufnr('%'),
+ \ 'vcol': 0,
+ \ 'linter_name': 'fakecodelinter',
+ \ 'nr': -1,
+ \ 'type': 'E',
+ \ 'code': 'E001',
+ \ 'text': 'This error does not exist',
+ \ },
\ ],
\ },
\}
@@ -237,6 +248,14 @@ Execute(The %code% and %ifcode% should be removed when there's no code):
AssertEqual 'Some information', GetLastMessage()
+Execute(The %code% should be formatted correctly when other variables contain 'code'):
+ let g:ale_echo_msg_format = '%s (%linter%% code%)'
+
+ call cursor(3, 5)
+ call ale#cursor#EchoCursorWarning()
+
+ AssertEqual 'This error does not exist (fakecodelinter E001)', GetLastMessage()
+
Execute(The buffer message format option should take precedence):
let g:ale_echo_msg_format = '%(code) %%s'
let b:ale_echo_msg_format = 'FOO %s'