aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/json_functions_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-06-10 23:29:37 +0300
committerZyX <kp-pav@yandex.ru>2016-06-11 00:08:59 +0300
commit244967bff918cbde43eea823c1bf0fa86d566623 (patch)
tree3c86cb91e015964e1020ecfad10347818b6ce4e5 /test/functional/eval/json_functions_spec.lua
parent92d5809052a456de5f877b28f72418b266141f58 (diff)
downloadrneovim-244967bff918cbde43eea823c1bf0fa86d566623.tar.gz
rneovim-244967bff918cbde43eea823c1bf0fa86d566623.tar.bz2
rneovim-244967bff918cbde43eea823c1bf0fa86d566623.zip
clint: Add rules that forbids spaces after a cast operator
https://neovim.io/develop/style-guide.xml#Horizontal_Whitespace Note that this errors out for e.g. if (has_mbyte) mb_copy_char((const char_u **)(&f), &t); \ (found in macros.h:151) or #define ECMD_SET_HELP 0x02 /* set b_help flag of (new) buffer before (found in ex_cmds.h:11) (note `(new) buffer`). I left this as-is because these pieces of code are already caught by another rule (braces near if and `/*`-style comments). Other false positives I found were: 1. `FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_WARN_UNUSED_RESULT`: rejected by requiring type name to start with `[a-zA-Z_]` (this makes `1` not be incorrectly recognized as a type). 2. `#define FOO(var) (var)`: rejected by creating `cast_line`. 3. `(expr) * (expr)`: rejected by constructing regexp so that unary operators require no spaces after them. 4. `int f(void) FUNC_ATTR_PURE`: rejected by requiring line to start with a space. 5. `"." STR(NVIM_VERSION_PATCH) NVIM_VERSION_PRERELEASE`: not rejected, such thing should be rare and it would be easy to get rid of the false positive by e.g. breaking line. Struct literals like `(MyStruct) { 4, 2 }` are not checked: 1. I am not sure whether they are under this rule at all (this is not a cast). 2. It would be hard to get rid of false positives (like the example with `if` above, but now for *valid* `if() {}`s).
Diffstat (limited to 'test/functional/eval/json_functions_spec.lua')
0 files changed, 0 insertions, 0 deletions