cpplint
Check C++ files configurably against Google's style guide
What it is and what it does
Cpplint is a Python-based linter that enforces Google's C++ style guide on source files. It originated as Google's internal tool but has been maintained as a community fork since Google stopped updating the public version. The tool runs as a command-line utility and can be integrated into pre-commit hooks or CI pipelines to catch style violations early.
The fork modernizes the original tool with Python 3 compatibility, recursive file discovery, customizable file extensions, JUnit XML output, and support for modern C++ features like `#pragma once`. It has no runtime dependencies and installs cleanly on Python 3.9 through 3.13, making it lightweight to add to development workflows.
Use it for:
- Enforce consistent C++ code style across a team or project by running cpplint in CI/CD pipelines to reject non-compliant pull requests.
- Integrate cpplint as a pre-commit hook to catch style violations before code is committed, reducing review friction.
- Scan large codebases recursively with custom file extensions to identify style issues across multiple directories and file types.
- Generate JUnit XML reports from cpplint output for integration with test dashboards and quality gates in build systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cpplint is a command-line static code checker that scans C/C++ files for style violations against Google's C++ style guide, with support for recursive file discovery, custom file extensions, and multiple output formats.
Yes. Cpplint is actively maintained, has no dependencies, installs easily, and is well-suited for teams adopting Google's C++ style guide. The permissive BSD license and broad Python version support (3.9–3.13) make it a low-risk addition to development workflows. Install via pipx to keep it isolated from project dependencies.
Install
cpplint on PyPI
pip
pip install cpplintuv
uv add cpplintpoetry
poetry add cpplintInstalling cpplint
Before you install
Low install friction with no runtime dependencies. Actively maintained with recent commits and a stable release cadence; supports Python 3.9 through 3.13.
License in practice
BSD-3-Clause is permissive and poses no restrictions on commercial or private use; you can use and modify cpplint freely.
Quickstart
pipx install cpplint
cpplint myfile.cpp
# Or as a pre-commit hook in .pre-commit-config.yaml:
# - repo: https://github.com/cpplint/cpplint
# rev: 2.0.0
# hooks:
# - id: cpplint
Requires Python 3.9 or later; typically installed via pipx rather than pip to avoid polluting the project environment.
Verify before relying
- Whether the fork's feature additions (recursive discovery, custom extensions, JUnit output) are stable and well-tested in production workflows.
- How actively the current maintainers (@aaronliu0130, @jayvdb) respond to issues and pull requests relative to the original Google version.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 493 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 624,130/month — #5,702 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cpplint-2.0.2-py3-none-any.whl
Keywords: c++, cpp, google style, lint
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
tclinttclint is a CLI linter, formatter, and language…
permissive · top 15,000 on PyPI
cmakelintcmakelint parses CMake files and reports style…
permissive · top 15,000 on PyPI
mr-propermr. Proper is a static code analyzer that…
permissive · top 15,000 on PyPI
rstcheckValidates reStructuredText syntax and checks…
permissive · top 5,000 on PyPI
sphinx-lintSphinx Lint checks reStructuredText and Python…
permissive · top 15,000 on PyPI
flawfinderFlawfinder scans C/C++ source code to identify…
copyleft · top 15,000 on PyPI
gitlint-coreLints Git commit messages against configurable…
permissive · top 5,000 on PyPI
shellcheck-pyProvides a pip-installable shellcheck binary…
permissive · top 5,000 on PyPI
yamllintyamllint checks YAML files for syntax errors,…
copyleft · top 1,000 on PyPI
hadolint-coatlProvides a pip-installable hadolint binary…
permissive · top 15,000 on PyPI