module documentation

Does google-lint on c++ files.

The goal of this script is to identify places in the code that may be in non-compliance with google style. It does not attempt to fix up these problems -- the point is to educate. It does also not attempt to find all problems, or to ensure that everything it does find is legitimately a problem.

In particular, we can get very confused by /* and // inside strings! We do a small hack, which is to ignore //'s with "'s after them on the same line, but it is far from perfect (in either direction).

Class CleansedLines Holds 4 copies of all lines with different preprocessing applied to them.
Class FileInfo Provides utility functions for filenames.
Class NestingState Holds states related to parsing braces.
Function CheckAltTokens Check alternative keywords being used in boolean expressions.
Function CheckBraces Looks for misplaced braces (e.g. at the end of line).
Function CheckBracesSpacing Checks for horizontal spacing near commas.
Function CheckCasts Various cast related checks.
Function CheckCheck Checks the use of CHECK and EXPECT macros.
Function CheckCommaSpacing Checks for horizontal spacing near commas and semicolons.
Function CheckComment Checks for common mistakes in comments.
Function CheckCStyleCast Checks for a C-style cast by looking for the pattern.
Function CheckEmptyBlockBody Look for empty loop/conditional body with only a single semicolon.
Function CheckForBadCharacters Logs an error for each line containing bad characters.
Function CheckForCopyright Logs an error if no Copyright message appears at the top of the file.
Function CheckForFunctionLengths Reports for long function bodies.
Function CheckForHeaderGuard Checks that the file contains a header guard.
Function CheckForIncludeWhatYouUse Reports for missing stl includes.
Function CheckForMultilineCommentsAndStrings Logs an error if we see /* ... */ or "..." that extend past one line.
Function CheckForNamespaceIndentation Undocumented
Function CheckForNewlineAtEOF Logs an error if there is no newline char at the end of the file.
Function CheckForNonConstReference Check for non-const references.
Function CheckForNonStandardConstructs Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Function CheckGlobalStatic Check for unsafe global or static objects.
Function CheckHeaderFileIncluded Logs an error if a .cc file does not include its header.
Function CheckIncludeLine Check rules that are applicable to #include lines.
Function CheckInvalidIncrement Checks for invalid increment *count++.
Function CheckItemIndentationInNamespace Undocumented
Function CheckLanguage Checks rules from the 'C++ language rules' section of cppguide.html.
Function CheckMakePairUsesDeduction Check that make_pair's template arguments are deduced.
Function CheckOperatorSpacing Checks for horizontal spacing around operators.
Function CheckParenthesisSpacing Checks for horizontal spacing around parentheses.
Function CheckPosixThreading Checks for calls to thread-unsafe functions.
Function CheckPrintf Check for printf related issues.
Function CheckRedundantOverrideOrFinal Check if line contains a redundant "override" or "final" virt-specifier.
Function CheckRedundantVirtual Check if line contains a redundant "virtual" function-specifier.
Function CheckSectionSpacing Checks for additional blank line issues related to sections.
Function CheckSpacing Checks for the correctness of various spacing issues in the code.
Function CheckSpacingForFunctionCall Checks for the correctness of various spacing around function calls.
Function CheckStyle Checks rules from the 'C++ style rules' section of cppguide.html.
Function CheckTrailingSemicolon Looks for redundant trailing semicolon.
Function CheckVlogArguments Checks that VLOG() is only used for defining a logging level.
Function CleanseComments Removes //-comments and single-line C-style /* */ comments.
Function CleanseRawStrings Removes C++11 raw strings from lines.
Function CloseExpression If input points to ( or { or [ or <, finds the position that closes it.
Function Error Logs the fact we've found a lint error.
Function ExpectingFunctionArgs Checks whether where function type arguments are expected.
Function FilesBelongToSameModule Check if these two filenames belong to the same module.
Function FindCheckMacro Find a replaceable CHECK-like macro.
Function FindEndOfExpressionInLine Find the position just after the end of current parenthesized expression.
Function FindNextMultiLineCommentEnd We are inside a comment, find the end marker.
Function FindNextMultiLineCommentStart Find the beginning marker for a multiline comment.
Function FindStartOfExpressionInLine Find position at the matching start of current expression.
Function FlagCxx11Features Flag those c++11 features that we only allow in certain places.
Function FlagCxx14Features Flag those C++14 features that we restrict.
Function GetHeaderGuardCPPVariable Returns the CPP variable that should be used as a header guard.
Function GetIndentLevel Return the number of leading spaces in line.
Function GetLineWidth Determines the width of the line in column positions.
Function GetPreviousNonBlankLine Return the most recent non-blank line and its line number.
Function IsBlankLine Returns true if the given line is blank.
Function IsBlockInNameSpace Checks that the new block is directly in a namespace.
Function IsCppString Does line terminate so, that the next symbol is in string constant.
Function IsDecltype Check if the token ending on (linenum, column) is decltype().
Function IsDerivedFunction Check if current line contains an inherited function.
Function IsErrorSuppressedByNolint Returns true if the specified error category is suppressed on this line.
Function IsForwardClassDeclaration Undocumented
Function IsHeaderExtension Undocumented
Function IsInitializerList Check if current line is inside constructor initializer list.
Function IsMacroDefinition Undocumented
Function IsOutOfLineMethodDefinition Check if current line contains an out-of-line method definition.
Function main Undocumented
Function Match Matches the string with the pattern, caching the compiled regexp.
Function ParseArguments Parses the command line arguments.
Function ParseNolintSuppressions Updates the global list of line error-suppressions.
Function PathSplitToList Returns the path split into a list by the separator.
Function PrintCategories Prints a list of all the error-categories used by error messages.
Function PrintUsage Prints a brief usage string and exits, optionally with an error message.
Function ProcessConfigOverrides Loads the configuration files and processes the config overrides.
Function ProcessFile Does google-lint on a single file.
Function ProcessFileData Performs lint checks and reports any errors to the given error function.
Function ProcessGlobalSuppresions Updates the list of global error suppressions.
Function ProcessHppHeadersOption Undocumented
Function ProcessLine Processes a single line in the file.
Function RemoveMultiLineComments Removes multiline (c-style) comments from lines.
Function RemoveMultiLineCommentsFromRange Clears a range of lines for multi-line comments.
Function ReplaceAll Replaces instances of pattern in a string with a replacement.
Function ResetNolintSuppressions Resets the set of NOLINT suppressions to empty.
Function ReverseCloseExpression If input points to ) or } or ] or >, finds the position that opens it.
Function Search Searches the string for the pattern, caching the compiled regexp.
Function ShouldCheckNamespaceIndentation This method determines if we should apply our namespace indentation check.
Function UpdateIncludeState Fill up the include_dict with new includes found from the file.
Class _BlockInfo Stores information about a generic block of code.
Class _ClassInfo Stores information about a class.
Class _CppLintState Maintains module-wide state..
Class _ExternCInfo Stores information about an 'extern "C"' block.
Class _FunctionState Tracks current function name and the number of lines in its body.
Class _IncludeState Tracks line numbers for includes, and the order in which includes appear.
Class _NamespaceInfo Stores information about a namespace.
Class _PreprocessorInfo Stores checkpoints of nesting stacks when #if/#else is seen.
Exception _IncludeError Indicates a problem with the include order in a file.
Function _AddFilters Adds more filter overrides.
Function _BackupFilters Saves the current filter list to backup storage.
Function _ClassifyInclude Figures out what kind of header 'include' is.
Function _DropCommonSuffixes Drops common suffixes like _test.cc or -inl.h from filename.
Function _Filters Returns the module's list of output filters, as a list.
Function _GetTextInside Retrieves all the text between matching open and close parentheses.
Function _IsSourceExtension File extension (excluding dot) matches a source file extension.
Function _IsType Check if expression looks like a type name, returns true if so.
Function _OutputFormat Gets the module's output format.
Function _Quiet Return's the module's quiet setting.
Function _RestoreFilters Restores filters previously backed up.
Function _SetCountingStyle Sets the module's counting options.
Function _SetFilters Sets the module's error-message filters.
Function _SetOutputFormat Sets the module's output format.
Function _SetQuiet Set the module's quiet status, and return previous setting.
Function _SetVerboseLevel Sets the module's verbosity, and returns the previous setting.
Function _ShouldPrintError If confidence >= verbose, category passes filter and is not suppressed.
Function _VerboseLevel Returns the module's verbosity setting.
Constant _ALT_TOKEN_REPLACEMENT Undocumented
Constant _ALT_TOKEN_REPLACEMENT_PATTERN Undocumented
Constant _BLOCK_ASM Undocumented
Constant _C_SYS_HEADER Undocumented
Constant _CHECK_MACROS Undocumented
Constant _CHECK_REPLACEMENT Undocumented
Constant _CPP_HEADERS Undocumented
Constant _CPP_SYS_HEADER Undocumented
Constant _DEFAULT_C_SUPPRESSED_CATEGORIES Undocumented
Constant _DEFAULT_FILTERS Undocumented
Constant _DEFAULT_KERNEL_SUPPRESSED_CATEGORIES Undocumented
Constant _EMPTY_CONDITIONAL_BODY_PATTERN Undocumented
Constant _END_ASM Undocumented
Constant _ERROR_CATEGORIES Undocumented
Constant _HEADERS_CONTAINING_TEMPLATES Undocumented
Constant _HEADERS_MAYBE_TEMPLATES Undocumented
Constant _INSIDE_ASM Undocumented
Constant _LEGACY_ERROR_CATEGORIES Undocumented
Constant _LIKELY_MY_HEADER Undocumented
Constant _MATCH_ASM Undocumented
Constant _NO_ASM Undocumented
Constant _OTHER_HEADER Undocumented
Constant _POSSIBLE_MY_HEADER Undocumented
Constant _RE_FIRST_COMPONENT Undocumented
Constant _RE_PATTERN_C_COMMENTS Undocumented
Constant _RE_PATTERN_CLEANSE_LINE_C_COMMENTS Undocumented
Constant _RE_PATTERN_CLEANSE_LINE_ESCAPES Undocumented
Constant _RE_PATTERN_CONST_REF_PARAM Undocumented
Constant _RE_PATTERN_EXPLICIT_MAKEPAIR Undocumented
Constant _RE_PATTERN_IDENT Undocumented
Constant _RE_PATTERN_INCLUDE Undocumented
Constant _RE_PATTERN_INVALID_INCREMENT Undocumented
Constant _RE_PATTERN_REF_PARAM Undocumented
Constant _RE_PATTERN_REF_STREAM_PARAM Undocumented
Constant _RE_PATTERN_STRING Undocumented
Constant _RE_PATTERN_TODO Undocumented
Constant _RE_PATTERN_TYPE Undocumented
Constant _SEARCH_C_FILE Undocumented
Constant _SEARCH_KERNEL_FILE Undocumented
Constant _TEST_FILE_SUFFIX Undocumented
Constant _THIRD_PARTY_HEADERS_PATTERN Undocumented
Constant _THREADING_LIST Undocumented
Constant _TYPES Undocumented
Constant _UNSAFE_FUNC_PREFIX Undocumented
Constant _USAGE Undocumented
Variable _cpplint_state Undocumented
Variable _error_suppressions Undocumented
Variable _global_error_suppressions Undocumented
Variable _hpp_headers Undocumented
Variable _line_length Undocumented
Variable _re_pattern_headers_maybe_templates Undocumented
Variable _re_pattern_templates Undocumented
Variable _regexp_compile_cache Undocumented
Variable _root Undocumented
Variable _root_debug Undocumented
Variable _valid_extensions Undocumented
def CheckAltTokens(filename, clean_lines, linenum, error):

Check alternative keywords being used in boolean expressions.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckBraces(filename, clean_lines, linenum, error):

Looks for misplaced braces (e.g. at the end of line).

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error):

Checks for horizontal spacing near commas.

Args:

filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState instance which maintains information about

the current stack of nested blocks being parsed.

error: The function to call with any errors found.

def CheckCasts(filename, clean_lines, linenum, error):

Various cast related checks.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckCheck(filename, clean_lines, linenum, error):

Checks the use of CHECK and EXPECT macros.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckCommaSpacing(filename, clean_lines, linenum, error):

Checks for horizontal spacing near commas and semicolons.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckComment(line, filename, linenum, next_line_start, error):

Checks for common mistakes in comments.

Args:
line: The line in question. filename: The name of the current file. linenum: The number of the line to check. next_line_start: The first non-whitespace column of the next line. error: The function to call with any errors found.
def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):

Checks for a C-style cast by looking for the pattern.

Args:

filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. cast_type: The string for the C++ cast to recommend. This is either

reinterpret_cast, static_cast, or const_cast, depending.

pattern: The regular expression used to find C-style casts. error: The function to call with any errors found.

Returns:
True if an error was emitted. False otherwise.
def CheckEmptyBlockBody(filename, clean_lines, linenum, error):

Look for empty loop/conditional body with only a single semicolon.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckForBadCharacters(filename, lines, error):

Logs an error for each line containing bad characters.

Two kinds of bad characters:

1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if the invalid UTF-8 occurred adjacent to a newline.

  1. NUL bytes. These are problematic for some tools.
Args:
filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found.
def CheckForCopyright(filename, lines, error):

Logs an error if no Copyright message appears at the top of the file.

def CheckForFunctionLengths(filename, clean_lines, linenum, function_state, error):

Reports for long function bodies.

For an overview why this is done, see: https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions

Uses a simplistic algorithm assuming other style guidelines (especially spacing) are followed. Only checks unindented functions, so class members are unchecked. Trivial bodies are unchecked, so constructors with huge initializer lists may be missed. Blank/comment lines are not counted so as to avoid encouraging the removal of vertical space and comments just to get through a lint check. NOLINT on the last line of a function disables this check.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. function_state: Current function name and lines in body so far. error: The function to call with any errors found.
def CheckForHeaderGuard(filename, clean_lines, error):

Checks that the file contains a header guard.

Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used.

Args:
filename: The name of the C++ header file. clean_lines: A CleansedLines instance containing the file. error: The function to call with any errors found.
def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, io=codecs):

Reports for missing stl includes.

This function will output warnings to make sure you are including the headers necessary for the stl containers and functions that you use. We only give one reason to include a header. For example, if you use both equal_to<> and less<> in a .h file, only one (the latter in the file) of these will be reported as a reason to include the <functional>.

Args:

filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. include_state: An _IncludeState instance. error: The function to call with any errors found. io: The IO factory to use to read the header file. Provided for unittest

injection.
def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):

Logs an error if we see /* ... */ or "..." that extend past one line.

/* ... */ comments are legit inside macros, for one line. Otherwise, we prefer // comments, so it's ok to warn about the other. Likewise, it's ok for strings to extend across multiple lines, as long as a line continuation character (backslash) terminates each line. Although not currently prohibited by the C++ style guide, it's ugly and unnecessary. We don't do well with either in this lint program, so we warn about both.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, error):

Undocumented

def CheckForNewlineAtEOF(filename, lines, error):

Logs an error if there is no newline char at the end of the file.

Args:
filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found.
def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, error):

Check for non-const references.

Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward.

Args:

filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState instance which maintains information about

the current stack of nested blocks being parsed.

error: The function to call with any errors found.

def CheckForNonStandardConstructs(filename, clean_lines, linenum, nesting_state, error):

Logs an error if we see certain non-ANSI constructs ignored by gcc-2.

Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const static"). - "%lld" instead of %qd" in printf-type functions. - "%1$d" is non-standard in printf-type functions. - "%" is an undefined character escape sequence. - text after #endif is not allowed. - invalid inner-style forward declaration. - >? and <? operators, and their >?= and <?= cousins.

Additionally, check for constructor/destructor style violations and reference members, as it is very convenient to do so while checking for gcc-2 compliance.

Args:

filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState instance which maintains information about

the current stack of nested blocks being parsed.
error: A callable to which errors are reported, which takes 4 arguments:
filename, line number, error level, and message
def CheckGlobalStatic(filename, clean_lines, linenum, error):

Check for unsafe global or static objects.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckHeaderFileIncluded(filename, include_state, error):

Logs an error if a .cc file does not include its header.

def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):

Check rules that are applicable to #include lines.

Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage must be put here.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. include_state: An _IncludeState instance in which the headers are inserted. error: The function to call with any errors found.
def CheckInvalidIncrement(filename, clean_lines, linenum, error):

Checks for invalid increment *count++.

For example following function: void increment_counter(int* count) {

*count++;

} is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckItemIndentationInNamespace(filename, raw_lines_no_comments, linenum, error):

Undocumented

def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error):

Checks rules from the 'C++ language rules' section of cppguide.html.

Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can.

Args:

filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. file_extension: The extension (without the dot) of the filename. include_state: An _IncludeState instance in which the headers are inserted. nesting_state: A NestingState instance which maintains information about

the current stack of nested blocks being parsed.

error: The function to call with any errors found.

def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):

Check that make_pair's template arguments are deduced.

G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are specified explicitly, and such use isn't intended in any case.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckOperatorSpacing(filename, clean_lines, linenum, error):

Checks for horizontal spacing around operators.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckParenthesisSpacing(filename, clean_lines, linenum, error):

Checks for horizontal spacing around parentheses.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckPosixThreading(filename, clean_lines, linenum, error):

Checks for calls to thread-unsafe functions.

Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. These tests guide the engineers to use thread-safe functions (when using posix directly).

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckPrintf(filename, clean_lines, linenum, error):

Check for printf related issues.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error):

Check if line contains a redundant "override" or "final" virt-specifier.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckRedundantVirtual(filename, clean_lines, linenum, error):

Check if line contains a redundant "virtual" function-specifier.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):

Checks for additional blank line issues related to sections.

Currently the only thing checked here is blank line before protected/private.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. class_info: A _ClassInfo objects. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):

Checks for the correctness of various spacing issues in the code.

Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't start a block with a blank line, don't end a function with a blank line, don't add a blank line after public/protected/private, don't have too many blank lines in a row.

Args:

filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState instance which maintains information about

the current stack of nested blocks being parsed.

error: The function to call with any errors found.

def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error):

Checks for the correctness of various spacing around function calls.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, error):

Checks rules from the 'C++ style rules' section of cppguide.html.

Most of these rules are hard to test (naming, comment style), but we do what we can. In particular we check for 2-space indents, line lengths, tab usage, spaces inside code, etc.

Args:

filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. file_extension: The extension (without the dot) of the filename. nesting_state: A NestingState instance which maintains information about

the current stack of nested blocks being parsed.

error: The function to call with any errors found.

def CheckTrailingSemicolon(filename, clean_lines, linenum, error):

Looks for redundant trailing semicolon.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CheckVlogArguments(filename, clean_lines, linenum, error):

Checks that VLOG() is only used for defining a logging level.

For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def CleanseComments(line):

Removes //-comments and single-line C-style /* */ comments.

Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed.
def CleanseRawStrings(raw_lines):

Removes C++11 raw strings from lines.

Before:
static const char kData[] = R"(
multi-line string )";
After:
static const char kData[] = ""
(replaced by blank line) "";
Args:
raw_lines: list of raw lines.
Returns:
list of lines with C++11 raw strings replaced by empty strings.
def CloseExpression(clean_lines, linenum, pos):

If input points to ( or { or [ or <, finds the position that closes it.

If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression.

TODO(unknown): cpplint spends a fair bit of time matching parentheses. Ideally we would want to index all opening and closing parentheses once and have CloseExpression be just a simple lookup, but due to preprocessor tricks, this is not so easy.

Args:
clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. pos: A position on the line.
Returns:
A tuple (line, linenum, pos) pointer past the closing brace, or (line, len(lines), -1) if we never find a close. Note we ignore strings and comments when matching; and the line we return is the 'cleansed' line at linenum.
def Error(filename, linenum, category, confidence, message):

Logs the fact we've found a lint error.

We log where the error was found, and also our confidence in the error, that is, how certain we are this is a legitimate style regression, and not a misidentification or a use that's sometimes justified.

False positives can be suppressed by the use of "cpplint(category)" comments on the offending line. These are parsed into _error_suppressions.

Args:

filename: The name of the file containing the error. linenum: The number of the line containing the error. category: A string used to describe the "category" this bug

falls under: "whitespace", say, or "runtime". Categories may have a hierarchy separated by slashes: "whitespace/indent".
confidence: A number from 1-5 representing a confidence score for
the error, with 5 meaning that we are certain of the problem, and 1 meaning that it could be a legitimate construct.

message: The error message.

def ExpectingFunctionArgs(clean_lines, linenum):

Checks whether where function type arguments are expected.

Args:
clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check.
Returns:
True if the line at 'linenum' is inside something that expects arguments of function types.
def FilesBelongToSameModule(filename_cc, filename_h):

Check if these two filenames belong to the same module.

The concept of a 'module' here is a as follows: foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the same 'module' if they are in the same directory. some/path/public/xyzzy and some/path/internal/xyzzy are also considered to belong to the same module here.

If the filename_cc contains a longer path than the filename_h, for example, '/absolute/path/to/base/sysinfo.cc', and this file would include 'base/sysinfo.h', this function also produces the prefix needed to open the header. This is used by the caller of this function to more robustly open the header file. We don't have access to the real include paths in this context, so we need this guesswork here.

Known bugs: tools/base/bar.cc and base/bar.h belong to the same module according to this implementation. Because of this, this function gives some false positives. This should be sufficiently rare in practice.

Args:
filename_cc: is the path for the .cc file filename_h: is the path for the header path
Returns:
Tuple with a bool and a string: bool: True if filename_cc and filename_h belong to the same module. string: the additional prefix needed to open the header file.
def FindCheckMacro(line):

Find a replaceable CHECK-like macro.

Args:
line: line to search on.
Returns:
(macro name, start position), or (None, -1) if no replaceable macro is found.
def FindEndOfExpressionInLine(line, startpos, stack):

Find the position just after the end of current parenthesized expression.

Args:
line: a CleansedLines line. startpos: start searching at this position. stack: nesting stack at startpos.
Returns:
On finding matching end: (index just after matching end, None) On finding an unclosed expression: (-1, None) Otherwise: (-1, new stack at end of this line)
def FindNextMultiLineCommentEnd(lines, lineix):

We are inside a comment, find the end marker.

def FindNextMultiLineCommentStart(lines, lineix):

Find the beginning marker for a multiline comment.

def FindStartOfExpressionInLine(line, endpos, stack):

Find position at the matching start of current expression.

This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1.

Args:
line: a CleansedLines line. endpos: start searching at this position. stack: nesting stack at endpos.
Returns:
On finding matching start: (index at matching start, None) On finding an unclosed expression: (-1, None) Otherwise: (-1, new stack at beginning of this line)
def FlagCxx11Features(filename, clean_lines, linenum, error):

Flag those c++11 features that we only allow in certain places.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def FlagCxx14Features(filename, clean_lines, linenum, error):

Flag those C++14 features that we restrict.

Args:
filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
def GetHeaderGuardCPPVariable(filename):

Returns the CPP variable that should be used as a header guard.

Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the named file.
def GetIndentLevel(line):

Return the number of leading spaces in line.

Args:
line: A string to check.
Returns:
An integer count of leading spaces, possibly zero.
def GetLineWidth(line):

Determines the width of the line in column positions.

Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode combining characters and wide characters.
def GetPreviousNonBlankLine(clean_lines, linenum):

Return the most recent non-blank line and its line number.

Args:
clean_lines: A CleansedLines instance containing the file contents. linenum: The number of the line to check.
Returns:
A tuple with two elements. The first element is the contents of the last non-blank line before the current line, or the empty string if this is the first non-blank line. The second is the line number of that line, or -1 if this is the first non-blank line.
def IsBlankLine(line):

Returns true if the given line is blank.

We consider a line to be blank if the line is empty or consists of only white spaces.

Args:
line: A line of a string.
Returns:
True, if the given line is blank.
def IsBlockInNameSpace(nesting_state, is_forward_declaration):

Checks that the new block is directly in a namespace.

Args:
nesting_state: The _NestingState object that contains info about our state. is_forward_declaration: If the class is a forward declared class.
Returns:
Whether or not the new block is directly in a namespace.
def IsCppString(line):

Does line terminate so, that the next symbol is in string constant.

This function does not consider single-line nor multi-line comments.

Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a string constant.
def IsDecltype(clean_lines, linenum, column):

Check if the token ending on (linenum, column) is decltype().

Args:
clean_lines: A CleansedLines instance containing the file. linenum: the number of the line to check. column: end column of the token to check.
Returns:
True if this token is decltype() expression, False otherwise.
def IsDerivedFunction(clean_lines, linenum):

Check if current line contains an inherited function.

Args:
clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check.
Returns:
True if current line contains a function with "override" virt-specifier.
def IsErrorSuppressedByNolint(category, linenum):

Returns true if the specified error category is suppressed on this line.

Consults the global error_suppressions map populated by ParseNolintSuppressions/ProcessGlobalSuppresions/ResetNolintSuppressions.

Args:
category: str, the category of the error. linenum: int, the current line number.
Returns:
bool, True iff the error should be suppressed due to a NOLINT comment or global suppression.
def IsForwardClassDeclaration(clean_lines, linenum):

Undocumented

def IsHeaderExtension(file_extension):

Undocumented

def IsInitializerList(clean_lines, linenum):

Check if current line is inside constructor initializer list.

Args:
clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check.
Returns:
True if current line appears to be inside constructor initializer list, False otherwise.
def IsMacroDefinition(clean_lines, linenum):

Undocumented

def IsOutOfLineMethodDefinition(clean_lines, linenum):

Check if current line contains an out-of-line method definition.

Args:
clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check.
Returns:
True if current line contains an out-of-line method definition.
def main():

Undocumented

def Match(pattern, s):

Matches the string with the pattern, caching the compiled regexp.

def ParseArguments(args):

Parses the command line arguments.

This may set the output format and verbosity level as side-effects.

Args:
args: The command line arguments:
Returns:
The list of filenames to lint.
def ParseNolintSuppressions(filename, raw_line, linenum, error):

Updates the global list of line error-suppressions.

Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed.

Args:
filename: str, the name of the input file. raw_line: str, the line of input text, with comments. linenum: int, the number of the current line. error: function, an error handler.
def PathSplitToList(path):

Returns the path split into a list by the separator.

Args:
path: An absolute or relative path (e.g. '/a/b/c/' or '../a')
Returns:
A list of path components (e.g. ['a', 'b', 'c]).
def PrintCategories():

Prints a list of all the error-categories used by error messages.

These are the categories used to filter messages via --filter.

def PrintUsage(message):

Prints a brief usage string and exits, optionally with an error message.

Args:
message: The optional error message.
def ProcessConfigOverrides(filename):

Loads the configuration files and processes the config overrides.

Args:
filename: The name of the file being processed by the linter.
Returns:
False if the current |filename| should not be processed further.
def ProcessFile(filename, vlevel, extra_check_functions=[]):

Does google-lint on a single file.

Args:

filename: The name of the file to parse.

vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default.

extra_check_functions: An array of additional check functions that will be
run on each source line. Each function takes 4 arguments: filename, clean_lines, line, error
def ProcessFileData(filename, file_extension, lines, error, extra_check_functions=[]):

Performs lint checks and reports any errors to the given error function.

Args:

filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. lines: An array of strings, each representing a line of the file, with the

last element being empty if the file is terminated with a newline.
error: A callable to which errors are reported, which takes 4 arguments:
filename, line number, error level, and message
extra_check_functions: An array of additional check functions that will be
run on each source line. Each function takes 4 arguments: filename, clean_lines, line, error
def ProcessGlobalSuppresions(lines):

Updates the list of global error suppressions.

Parses any lint directives in the file that have global effect.

Args:
lines: An array of strings, each representing a line of the file, with the
last element being empty if the file is terminated with a newline.
def ProcessHppHeadersOption(val):

Undocumented

def ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=[]):

Processes a single line in the file.

Args:

filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. clean_lines: An array of strings, each representing a line of the file,

with comments stripped.

line: Number of line being processed. include_state: An _IncludeState instance in which the headers are inserted. function_state: A _FunctionState instance which counts function lines, etc. nesting_state: A NestingState instance which maintains information about

the current stack of nested blocks being parsed.
error: A callable to which errors are reported, which takes 4 arguments:
filename, line number, error level, and message
extra_check_functions: An array of additional check functions that will be
run on each source line. Each function takes 4 arguments: filename, clean_lines, line, error
def RemoveMultiLineComments(filename, lines, error):

Removes multiline (c-style) comments from lines.

def RemoveMultiLineCommentsFromRange(lines, begin, end):

Clears a range of lines for multi-line comments.

def ReplaceAll(pattern, rep, s):

Replaces instances of pattern in a string with a replacement.

The compiled regex is kept in a cache shared by Match and Search.

Args:
pattern: regex pattern rep: replacement text s: search string
Returns:
string with replacements made (or original string if no replacements)
def ResetNolintSuppressions():

Resets the set of NOLINT suppressions to empty.

def ReverseCloseExpression(clean_lines, linenum, pos):

If input points to ) or } or ] or >, finds the position that opens it.

If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the linenum/pos that correspond to the opening of the expression.

Args:
clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. pos: A position on the line.
Returns:
A tuple (line, linenum, pos) pointer at the opening brace, or (line, 0, -1) if we never find the matching opening brace. Note we ignore strings and comments when matching; and the line we return is the 'cleansed' line at linenum.
def Search(pattern, s):

Searches the string for the pattern, caching the compiled regexp.

def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, raw_lines_no_comments, linenum):

This method determines if we should apply our namespace indentation check.

Args:

nesting_state: The current nesting state. is_namespace_indent_item: If we just put a new class on the stack, True.

If the top of the stack is not a class, or we did not recently add the class, False.

raw_lines_no_comments: The lines without the comments. linenum: The current line number we are processing.

Returns:
True if we should apply our namespace indentation check. Currently, it only works for classes and namespaces inside of a namespace.
def UpdateIncludeState(filename, include_dict, io=codecs):

Fill up the include_dict with new includes found from the file.

Args:
filename: the name of the header to read. include_dict: a dictionary in which the headers are inserted. io: The io factory to use to read the file. Provided for testability.
Returns:
True if a header was successfully added. False otherwise.
def _AddFilters(filters):

Adds more filter overrides.

Unlike _SetFilters, this function does not reset the current list of filters available.

Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
def _BackupFilters():

Saves the current filter list to backup storage.

def _ClassifyInclude(fileinfo, include, is_system):

Figures out what kind of header 'include' is.

Args:
fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "".
Returns:
One of the _XXX_HEADER constants.
For example:
>>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'stdio.h', True)
_C_SYS_HEADER
>>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'string', True)
_CPP_SYS_HEADER
>>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/foo.h', False)
_LIKELY_MY_HEADER
>>> _ClassifyInclude(FileInfo('foo/foo_unknown_extension.cc'),
...                  'bar/foo_other_ext.h', False)
_POSSIBLE_MY_HEADER
>>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/bar.h', False)
_OTHER_HEADER
def _DropCommonSuffixes(filename):

Drops common suffixes like _test.cc or -inl.h from filename.

For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/foo_unusualinternal.h')
'foo/foo_unusualinternal'
Args:
filename: The input filename.
Returns:
The filename with the common suffix removed.
def _Filters():

Returns the module's list of output filters, as a list.

def _GetTextInside(text, start_pattern):

Retrieves all the text between matching open and close parentheses.

Given a string of lines and a regular expression string, retrieve all the text following the expression and between opening punctuation symbols like (, [, or {, and the matching close-punctuation symbol. This properly nested occurrences of the punctuations, so for the text like

printf(a(), b(c()));

a call to _GetTextInside(text, r'printf(') will return 'a(), b(c())'. start_pattern must match string having an open punctuation symbol at the end.

Args:
text: The lines to extract text. Its comments and strings must be elided.
It can be single line and can span multiple lines.
start_pattern: The regexp string indicating where to start extracting
the text.
Returns:
The extracted text. None if either the opening string or ending punctuation could not be found.
def _IsSourceExtension(s):

File extension (excluding dot) matches a source file extension.

def _IsType(clean_lines, nesting_state, expr):

Check if expression looks like a type name, returns true if so.

Args:

clean_lines: A CleansedLines instance containing the file. nesting_state: A NestingState instance which maintains information about

the current stack of nested blocks being parsed.

expr: The expression to check.

Returns:
True, if token looks like a type.
def _OutputFormat():

Gets the module's output format.

def _Quiet():

Return's the module's quiet setting.

def _RestoreFilters():

Restores filters previously backed up.

def _SetCountingStyle(level):

Sets the module's counting options.

def _SetFilters(filters):

Sets the module's error-message filters.

These filters are applied when deciding whether to emit a given error message.

Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
def _SetOutputFormat(output_format):

Sets the module's output format.

def _SetQuiet(quiet):

Set the module's quiet status, and return previous setting.

def _SetVerboseLevel(level):

Sets the module's verbosity, and returns the previous setting.

def _ShouldPrintError(category, confidence, linenum):

If confidence >= verbose, category passes filter and is not suppressed.

def _VerboseLevel():

Returns the module's verbosity setting.

_ALT_TOKEN_REPLACEMENT: dict[str, str] =

Undocumented

Value
{'and': '&&',
 'bitor': '|',
 'or': '||',
 'xor': '^',
 'compl': '~',
 'bitand': '&',
 'and_eq': '&=',
...
_ALT_TOKEN_REPLACEMENT_PATTERN =

Undocumented

Value
re.compile(('[ =()]('+"""|""".join(_ALT_TOKEN_REPLACEMENT.keys())+')(?=[ (]|$)'))
_BLOCK_ASM: int =

Undocumented

Value
3
_C_SYS_HEADER: int =

Undocumented

Value
1
_CHECK_MACROS: list[str] =

Undocumented

Value
['DCHECK',
 'CHECK',
 'EXPECT_TRUE',
 'ASSERT_TRUE',
 'EXPECT_FALSE',
 'ASSERT_FALSE']
_CHECK_REPLACEMENT =

Undocumented

Value
dict([(m, {}) for m in _CHECK_MACROS])
_CPP_HEADERS =

Undocumented

Value
frozenset(['algobase.h',
           'algo.h',
           'alloc.h',
           'builtinbuf.h',
           'bvector.h',
           'complex.h',
           'defalloc.h',
...
_CPP_SYS_HEADER: int =

Undocumented

Value
2
_DEFAULT_C_SUPPRESSED_CATEGORIES: list[str] =

Undocumented

Value
['readability/casting']
_DEFAULT_FILTERS: list[str] =

Undocumented

Value
['-build/include_alpha']
_DEFAULT_KERNEL_SUPPRESSED_CATEGORIES: list[str] =

Undocumented

Value
['whitespace/tab']
_EMPTY_CONDITIONAL_BODY_PATTERN =

Undocumented

Value
re.compile(r'^\s*$',
           re.DOTALL)
_END_ASM: int =

Undocumented

Value
2
_ERROR_CATEGORIES: list[str] =

Undocumented

Value
['build/class',
 'build/c++11',
 'build/c++14',
 'build/c++tr1',
 'build/deprecated',
 'build/endif_comment',
 'build/explicit_make_pair',
...
_HEADERS_CONTAINING_TEMPLATES: tuple[tuple, ...] =

Undocumented

Value
(('<deque>', ('deque')),
 ('<functional>',
  ('unary_function',
   'binary_function',
   'plus',
   'minus',
   'multiplies',
...
_HEADERS_MAYBE_TEMPLATES: tuple[tuple, ...] =

Undocumented

Value
(('<algorithm>', ('copy', 'max', 'min', 'min_element', 'sort', 'transform')),
 ('<utility>', ('forward', 'make_pair', 'move', 'swap')))
_INSIDE_ASM: int =

Undocumented

Value
1
_LEGACY_ERROR_CATEGORIES: list[str] =

Undocumented

Value
['readability/streams', 'readability/function']
_LIKELY_MY_HEADER: int =

Undocumented

Value
3
_MATCH_ASM =

Undocumented

Value
re.compile(r'^\s*(?:asm|_asm|__asm|__asm__)(?:\s+(volatile|__volatile__))?\s*[\{
\(]')
_NO_ASM: int =

Undocumented

Value
0
_OTHER_HEADER: int =

Undocumented

Value
5
_POSSIBLE_MY_HEADER: int =

Undocumented

Value
4
_RE_FIRST_COMPONENT =

Undocumented

Value
re.compile(r'^[^-_\.]+')
_RE_PATTERN_C_COMMENTS: str =

Undocumented

Value
'/\\*(?:[^*]|\\*(?!/))*\\*/'
_RE_PATTERN_CLEANSE_LINE_C_COMMENTS =

Undocumented

Value
re.compile(('(\\s*'+_RE_PATTERN_C_COMMENTS+'\\s*$|'+_RE_PATTERN_C_COMMENTS+'\\s+|'
+'\\s+'+_RE_PATTERN_C_COMMENTS+'(?=\\W)|'+_RE_PATTERN_C_COMMENTS+')'))
_RE_PATTERN_CLEANSE_LINE_ESCAPES =

Undocumented

Value
re.compile(r'\\([abfnrtv\?"\\\']|\d+|x[0-9a-fA-F]+)')
_RE_PATTERN_CONST_REF_PARAM =

Undocumented

Value
'(?:.*\\s*\\bconst\\s*&\\s*'+_RE_PATTERN_IDENT+'|const\\s+'+_RE_PATTERN_TYPE+'\\
s*&\\s*'+_RE_PATTERN_IDENT+')'
_RE_PATTERN_EXPLICIT_MAKEPAIR =

Undocumented

Value
re.compile(r'\bmake_pair\s*<')
_RE_PATTERN_IDENT: str =

Undocumented

Value
'[_a-zA-Z]\\w*'
_RE_PATTERN_INCLUDE =

Undocumented

Value
re.compile(r'^\s*#\s*include\s*([<"])([^>"]*)[>"].*$')
_RE_PATTERN_INVALID_INCREMENT =

Undocumented

Value
re.compile(r'^\s*\*\w+(\+\+|--);')
_RE_PATTERN_REF_PARAM =

Undocumented

Value
re.compile(('('+_RE_PATTERN_TYPE+'(?:\\s*(?:\\bconst\\b|[*]))*\\s*&\\s*'+_RE_PATTERN_IDENT
+')\\s*(?:=[^,()]+)?[,)]'))
_RE_PATTERN_REF_STREAM_PARAM =

Undocumented

Value
'(?:.*stream\\s*&\\s*'+_RE_PATTERN_IDENT+')'
_RE_PATTERN_STRING =

Undocumented

Value
re.compile(r'\bstring\b')
_RE_PATTERN_TODO =

Undocumented

Value
re.compile(r'^//(\s*)TODO(\(.+?\))?:?(\s|$)?')
_RE_PATTERN_TYPE: str =

Undocumented

Value
'(?:const\\s+)?(?:typename\\s+|class\\s+|struct\\s+|union\\s+|enum\\s+)?(?:\\w|\
\s*<(?:<(?:<[^<>]*>|[^<>])*>|[^<>])*>|::)+'
_SEARCH_C_FILE =

Undocumented

Value
re.compile(r'\b(?:LINT_C_FILE|vim?:\s*.*(\s*|:)filetype=c(\s*|:|$))')
_SEARCH_KERNEL_FILE =

Undocumented

Value
re.compile(r'\b(?:LINT_KERNEL_FILE)')
_TEST_FILE_SUFFIX: str =

Undocumented

Value
'(_test|_unittest|_regtest)$'
_THIRD_PARTY_HEADERS_PATTERN =

Undocumented

Value
re.compile(r'^(?:[^/]*[A-Z][^/]*\.h|lua\.h|lauxlib\.h|lualib\.h)$')
_THREADING_LIST =

Undocumented

Value
(('asctime(', 'asctime_r(', (_UNSAFE_FUNC_PREFIX+'asctime\\([^)]+\\)')),
 ('ctime(', 'ctime_r(', (_UNSAFE_FUNC_PREFIX+'ctime\\([^)]+\\)')),
 ('getgrgid(', 'getgrgid_r(', (_UNSAFE_FUNC_PREFIX+'getgrgid\\([^)]+\\)')),
 ('getgrnam(', 'getgrnam_r(', (_UNSAFE_FUNC_PREFIX+'getgrnam\\([^)]+\\)')),
 ('getlogin(', 'getlogin_r(', (_UNSAFE_FUNC_PREFIX+'getlogin\\(\\)')),
 ('getpwnam(', 'getpwnam_r(', (_UNSAFE_FUNC_PREFIX+'getpwnam\\([^)]+\\)')),
 ('getpwuid(', 'getpwuid_r(', (_UNSAFE_FUNC_PREFIX+'getpwuid\\([^)]+\\)')),
...
_TYPES =

Undocumented

Value
re.compile(r'^(?:(char(16_t|32_t)?)|wchar_t|bool|short|int|long|signed|unsigned|
float|double|(ptrdiff_t|size_t|max_align_t|nullptr_t)|(u?int(_fast|least)?(8|16|
32|64)_t)|(u?int(max|ptr)_t)|)$')
_UNSAFE_FUNC_PREFIX: str =

Undocumented

Value
'(?:[-+*/=%^&|(<]\\s*|>\\s+)'
_USAGE: str =

Undocumented

Value
'''
Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
                   [--counting=total|toplevel|detailed] [--root=subdir]
                   [--linelength=digits] [--headers=x,y,...]
                   [--quiet]
        <file> [file] ...

...
_cpplint_state =

Undocumented

_error_suppressions: dict =

Undocumented

_global_error_suppressions: dict =

Undocumented

_hpp_headers =

Undocumented

_line_length: int =

Undocumented

_re_pattern_headers_maybe_templates: list =

Undocumented

_re_pattern_templates: list =

Undocumented

_regexp_compile_cache: dict =

Undocumented

_root =

Undocumented

_root_debug: bool =

Undocumented

_valid_extensions =

Undocumented