aboutsummaryrefslogtreecommitdiff
path: root/src/clint.py
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-12-12 01:13:04 +0300
committerZyX <kp-pav@yandex.ru>2017-12-12 08:43:31 +0300
commit932ea7a0d1d19288fad719afd52e9cbeb924c4c2 (patch)
tree24293d74172a92436b1c5e8dbe7b2425e9a7dd2c /src/clint.py
parent45998deb5d325c7a44ce38b0c7d954919458f105 (diff)
downloadrneovim-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-xsrc/clint.py9
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) {