LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

cpplint

Google C++ style guide checker

TLDR

Check single file
$ cpplint [file.cpp]
copy
Check multiple files
$ cpplint [file1.cpp] [file2.cpp]
copy
Recursive directory check
$ cpplint --recursive [src/]
copy
Filter specific categories
$ cpplint --filter=-whitespace,+build [file.cpp]
copy
Set line length
$ cpplint --linelength=[120] [file.cpp]
copy
Output in different format
$ cpplint --output=[vs7] [file.cpp]
copy

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 to enforce consistent code standards across projects.The tool examines source files for compliance with naming conventions, spacing rules, comment formatting, header guard patterns, and many other style requirements. It helps teams maintain uniform code style and catch common errors before code review.Originally developed by Google for internal use, cpplint is now maintained as an open-source project. While designed specifically for Google's style guide, its rules can be filtered and customized for projects with different conventions.

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

CONFIGURATION

CPPLINT.cfg

Project-wide configuration file for filters, line length, root directory, and excluded paths.

FILTER CATEGORIES

- build: Build-related issues- legal: Copyright/license issues- readability: Code readability- runtime: Runtime issues- whitespace: Spacing and formattingPrefix with - to disable, + to enable.

INSTALL

brew install cpplint
copy
nix profile install nixpkgs#cpplint
copy

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

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid