diff options
author | ZyX <kp-pav@yandex.ru> | 2017-12-12 01:13:04 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-12-12 08:43:31 +0300 |
commit | 932ea7a0d1d19288fad719afd52e9cbeb924c4c2 (patch) | |
tree | 24293d74172a92436b1c5e8dbe7b2425e9a7dd2c /src/clint.py | |
parent | 45998deb5d325c7a44ce38b0c7d954919458f105 (diff) | |
download | rneovim-932ea7a0d1d19288fad719afd52e9cbeb924c4c2.tar.gz rneovim-932ea7a0d1d19288fad719afd52e9cbeb924c4c2.tar.bz2 rneovim-932ea7a0d1d19288fad719afd52e9cbeb924c4c2.zip |
clint,eval: Make linter check for direct usage of list attributes
Diffstat (limited to 'src/clint.py')
-rwxr-xr-x | src/clint.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/clint.py b/src/clint.py index e63175a69b..8426807c80 100755 --- a/src/clint.py +++ b/src/clint.py @@ -201,6 +201,7 @@ _ERROR_CATEGORIES = [ 'runtime/printf', 'runtime/printf_format', 'runtime/threadsafe_fn', + 'runtime/deprecated', 'syntax/parenthesis', 'whitespace/alignment', 'whitespace/blank_line', @@ -3200,6 +3201,14 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, if match: error(filename, linenum, 'runtime/printf', 4, 'Use xstrlcat or snprintf instead of %s' % match.group(1)) + if not Search(r'eval/typval\.[ch]$', filename): + match = Search(r'(?:\.|->)' + r'(?:lv_(?:first|last|refcount|len|watch|idx(?:_item)?' + r'|copylist|lock)' + r'|li_(?:next|prev|tv))\b', line) + if match: + error(filename, linenum, 'runtime/deprecated', 4, + 'Accessing list_T internals directly is prohibited') # Check for suspicious usage of "if" like # } if (a == b) { |