Cpplint Reference
This page provides a list of common cpplint errors, along with
links to the correct styling approach. Understanding these errors will
help you debug and improve your code to meet the Google C++ Style
Guide requirements. Use this reference to identify and resolve
style issues efficiently.
Access Specifier Indent Detected
Section titled “Access Specifier Indent ”public: should be indented +1 space inside class ClassName [whitespace/indent] [3]Do not leave a blank line after "public:" [whitespace/blank_line] [3]private: should be indented +1 space inside class ClassName [whitespace/indent] [3]Do not leave a blank line after "private:" [whitespace/blank_line] [3]protected: should be indented +1 space inside class ClassName [whitespace/indent] [3]Do not leave a blank line after "protected:" [whitespace/blank_line] [3]Class Blank Space Detected
Section titled “Class Blank Space ”Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2]Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3]Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]Class Data Member Not Detected
Section titled “Class Data Member ”Done processing driver.ccClass Name Not Detected
Section titled “Class Name ”Done processing driver.ccColumn Length Detected
Section titled “Column Length ”Lines should be <= 80 characters long [whitespace/line_length] [2]Commenting Detected
Section titled “Commenting ”At least two spaces is best between code and comments [whitespace/comments] [2]Constant Not Detected
Section titled “Constant ”Done processing driver.ccControl Structures Detected
Section titled “Control Structures ”# General ErrorsRedundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2]Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3]{ should almost always be at the end of the previous line [whitespace/braces] [4]Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]Empty loop bodies should use {} or continue [whitespace/empty_loop_body] [5]
# Else ErrorsAn else should appear on the same line as the preceding } [whitespace/newline] [4]Else clause should be indented at the same level as if. Ambiguous nested if/else chains require braces. [readability/braces] [4]If an else has a brace on one side, it should have it on both [readability/braces] [5]Copyright Detected
Section titled “Copyright ”No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5]Function Mostly Detected
Section titled “Function ”Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2]Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3]Extra space after ( in function call [whitespace/parens] [4]Extra space before ( in function call [whitespace/parens] [4]Missing space before { [whitespace/braces] [5]Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]{ should almost always be at the end of the previous line [whitespace/braces] [4]Header Guards Falsely Detected
Section titled “Header Guards ”#ifndef header guard has wrong style, please use: FILE_PATH [build/header_guard] [5]#endif line should be "#endif // FILE_PATH" [build/header_guard] [5]Include File Falsely Detected
Section titled “Include File ”Include the directory when naming header files [build/include_subdir] [4]Indentation Not Detected
Section titled “Indentation ”Done processing driver.ccMakefile Detected
Section titled “Makefile ”*** missing separator. Stop.Namespace Not Detected
Section titled “Namespace ”Done processing driver.ccNewline Character Detected
Section titled “Newline Character ”Could not find a newline character at the end of the file. [whitespace/ending_newline] [5]Variable Not Detected
Section titled “Variable ”Done processing driver.cc