tools: check for std::vector<v8::Local> in lint · nodejs/node@dab7f6b

@@ -6475,6 +6475,19 @@ def CheckItemIndentationInNamespace(filename, raw_lines_no_comments, linenum,

64756475

error(filename, linenum, 'runtime/indentation_namespace', 4,

64766476

'Do not indent within a namespace')

647764776478+

def CheckLocalVectorUsage(filename, lines, error):

6479+

"""Logs an error if std::vector<v8::Local<T>> is used.

6480+

Args:

6481+

filename: The name of the current file.

6482+

lines: An array of strings, each representing a line of the file.

6483+

error: The function to call with any errors found.

6484+

"""

6485+

for linenum, line in enumerate(lines):

6486+

if (Search(r'\bstd::vector<v8::Local<[^>]+>>', line) or

6487+

Search(r'\bstd::vector<Local<[^>]+>>', line)):

6488+

error(filename, linenum, 'runtime/local_vector', 5,

6489+

'Do not use std::vector<v8::Local<T>>. '

6490+

'Use v8::LocalVector<T> instead.')

6478649164796492

def ProcessLine(filename, file_extension, clean_lines, line,

64806493

include_state, function_state, nesting_state, error,

@@ -6645,6 +6658,8 @@ def ProcessFileData(filename, file_extension, lines, error,

6645665866466659

CheckInlineHeader(filename, include_state, error)

664766606661+

CheckLocalVectorUsage(filename, lines, error)

6662+66486663

def ProcessConfigOverrides(filename):

66496664

""" Loads the configuration files and processes the config overrides.

66506665