cpplint
TLDR
Check single file
$ cpplint [file.cpp]
Check multiple files$ cpplint [file1.cpp] [file2.cpp]
Recursive directory check$ cpplint --recursive [src/]
Filter specific categories$ cpplint --filter=-whitespace,+build [file.cpp]
Set line length$ cpplint --linelength=[120] [file.cpp]
Output in different format$ cpplint --output=[vs7] [file.cpp]
SYNOPSIS
cpplint [options] files
DESCRIPTION
cpplint is a static code checker for C++ that verifies code against Google's C++ style guide. It checks for style errors, formatting issues, and common programming mistakes.
Originally developed by Google, now maintained as an open-source project.
PARAMETERS
--recursive
Check files in subdirectories recursively--filter=-/+categories
Enable/disable specific warning categories--linelength=length
Maximum line length (default 80)--extensions=list
File extensions to process--headers=list
Header file extensions--output=format
Output format: emacs, vs7, eclipse, junit, sed, gsed--counting=type
Count errors: total, toplevel, detailed--root=dir
Project root for header guard paths--exclude=pattern
Exclude files matching pattern
FILTER CATEGORIES
- build: Build-related issues
- legal: Copyright/license issues
- readability: Code readability
- runtime: Runtime issues
- whitespace: Spacing and formatting
Prefix with - to disable, + to enable.
CAVEATS
Designed specifically for Google style guide compliance. Some rules may not apply to all projects. Use CPPLINT.cfg file for project-wide configuration.
SEE ALSO
clang-format(1), clang-tidy(1), cppcheck(1)


