diff options
author | Jon Parise <jon@indelible.org> | 2021-09-08 05:48:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-08 21:48:48 +0900 |
commit | c5c58f5bf82bf1cd6782d66e08d22af41de8e8f7 (patch) | |
tree | 4c9019e3f3d22154e09aa724da15264e51366a64 | |
parent | 42aadf6a263af953e206490b80d6b8b97ef08cf8 (diff) | |
download | ale-c5c58f5bf82bf1cd6782d66e08d22af41de8e8f7.zip |
Improve the thriftcheck handler pattern (#3893)
More recent versions of thriftcheck use a more compliant GCC-style
output format which includes a space before the "severity" group.
This matches similar tools, like shellcheck.
This change adjusts the handler's pattern to parse this format in a
backwards-compatible way (even though backwards compatibility isn't
critical long-term as thriftcheck itself is close to its 1.0 release).
-rw-r--r-- | ale_linters/thrift/thriftcheck.vim | 6 | ||||
-rw-r--r-- | test/handler/test_thriftcheck_handler.vader | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ale_linters/thrift/thriftcheck.vim b/ale_linters/thrift/thriftcheck.vim index 7b8cbee1..bf929d10 100644 --- a/ale_linters/thrift/thriftcheck.vim +++ b/ale_linters/thrift/thriftcheck.vim @@ -13,9 +13,9 @@ endfunction function! ale_linters#thrift#thriftcheck#Handle(buffer, lines) abort " Matches lines like the following: " - " file.thrift:1:1:error: "py" namespace must match "^idl\\." (namespace.pattern) - " file.thrift:3:5:warning: 64-bit integer constant -2147483649 may not work in all languages (int.64bit) - let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+):(\l+): (.*) \((.*)\)$' + " file.thrift:1:1: error: "py" namespace must match "^idl\\." (namespace.pattern) + " file.thrift:3:5: warning: 64-bit integer constant -2147483649 may not work in all languages (int.64bit) + let l:pattern = '\v^[a-zA-Z]?:?[^:]+:(\d+):(\d+): ?([^:]+): (.+) \(([^\)]+)\)$' let l:output = [] diff --git a/test/handler/test_thriftcheck_handler.vader b/test/handler/test_thriftcheck_handler.vader index efe62593..e80e5050 100644 --- a/test/handler/test_thriftcheck_handler.vader +++ b/test/handler/test_thriftcheck_handler.vader @@ -23,6 +23,6 @@ Execute(The thriftcheck handler should handle basic warnings and errors): \ }, \ ], \ ale_linters#thrift#thriftcheck#Handle(1, [ - \ 'file.thrift:1:1:error: "py" namespace must match "^idl\\." (namespace.pattern)', - \ 'file.thrift:3:5:warning: 64-bit integer constant -2147483649 may not work in all languages (int.64bit)', + \ 'file.thrift:1:1: error: "py" namespace must match "^idl\\." (namespace.pattern)', + \ 'file.thrift:3:5: warning: 64-bit integer constant -2147483649 may not work in all languages (int.64bit)', \ ]) |