Cpplint scans C and C++ sources for style issues aligned with Google's C++ style guide. Community maintainers extend the original Google tool for modern C++ and wider project use.
Overview
Cpplint is a command-line linter that reports style problems in C and C++ files according to Google's C++ style guide. Google no longer maintains the public version; this fork updates behavior, accepts community fixes, and aims to stay usable across more codebases. The upstream public cpplint release is no longer maintained.
You install it as a Python package from PyPI and run it against file paths with optional filters and excludes. It supports recursive discovery, custom file extensions, pre-commit hooks, and NOLINTBEGIN/NOLINTEND regions to skip blocks. Recent changes add Python 3 support, pragma once handling, and recognition of additional modern C++ constructs.
MegaLinter can run cpplint in CI pipelines, and maintainers document integration there. The tool remains focused on static style checking rather than semantic analysis or compilation.
Teams already standardized on Google's C++ conventions can adopt cpplint locally or in hooks without adopting a full IDE-specific analyzer.
Key features
- Google C++ style enforcement
- PyPI-installable CLI
- Pre-commit hook support
- Recursive file discovery
- Custom extensions and excludes
- NOLINT block suppression
- Modern C++ feature awareness
- MegaLinter CI integration
Use cases
- Enforcing team C++ style
- CI style gates
- Pre-commit local checks
- Legacy Google-style codebases
- Contributions to mixed C/C++ repos