Linters
What is Cpplint? An introduction to the cpplint project's C/C++ style linter
Cpplint is a command-line tool that checks C/C++ files for style issues against Google's C++ style guide. It was originally developed and maintained by Google, and the version described here is a fork that continues the work. It reports style problems so they can be fixed before code is merged.
- Tool
- Cpplint
- Made by
- cpplint project
- Official site
- github.com/cpplint/cpplint
- Category
- Linters
Who makes Cpplint
Cpplint is published by the cpplint project. The tool was originally developed and maintained by Google, but Google no longer maintains the public version of cpplint.
The current project is a fork that aims to modernize cpplint and be more open to fixes and features. The official website, the project's GitHub repository, is linked below.
Official website: github.com/cpplint/cpplint
What Cpplint is for
Cpplint checks C/C++ source files against Google's C++ style guide. Its job is to find style issues, so a team that follows that guide can detect deviations automatically instead of catching them in code review.
Because it runs from the command line, it can be invoked on individual files or wired into scripted workflows.
Who Cpplint is for
Cpplint suits developers and teams who write C/C++ and want their code to follow Google's C++ style guide. The vendor does not state a specific audience.
It also fits teams that already use Python-based tooling, since it is distributed as a package on PyPI, and teams that run checks in CI or before commits.
Notable capabilities
Cpplint is a focused style checker, and its capabilities concern how it is installed, where it runs and how checks are controlled.
- Style checking: it checks C/C++ files for style issues against Google's C++ style guide.
- PyPI distribution: it is distributed as a package on PyPI, so it installs with standard Python tooling.
- uv tool installation: it can be installed as a uv tool.
- Pre-commit hook: it can run as a pre-commit hook, so files are checked before they are committed.
- MegaLinter inclusion: it is included in MegaLinter, an open-source linter aggregator for CI.
- Selective exclusion: code blocks can be excluded from checking with NOLINTBEGIN and NOLINTEND comments.
- Pragma once: it supports #pragma once as an alternative to header include guards.
- Modern C++: the fork adds support for more modern C++ features.
How Cpplint fits linters
Within the linters category, Cpplint is a style-oriented tool for C/C++ with one reference point, Google's C++ style guide. It concentrates on style rather than on a broad range of analysis.
In Linthelm's wider niche of linters, static analysis and code quality tools, it covers the stylistic layer of code quality. Its pre-commit hook and MegaLinter support let it run as an automated gate alongside other checks.
Frequently asked questions
What is Cpplint used for?
Cpplint checks C/C++ files for style issues against Google's C++ style guide. It is a command-line tool.
Who develops Cpplint?
Cpplint was originally developed and maintained by Google. Google no longer maintains the public version, which is now carried on by the cpplint project as a fork aiming to modernize it.
How do I install Cpplint?
Cpplint is distributed as a package on PyPI and can also be installed as a uv tool.
Can Cpplint run as a pre-commit hook?
Yes. Cpplint can run as a pre-commit hook, and it is also included in MegaLinter for CI.
Can I exclude code from Cpplint checks?
Yes. Code blocks can be excluded from checking by wrapping them in NOLINTBEGIN and NOLINTEND comments.
Linthelm is independent and is not affiliated with cpplint project. Product names belong to their owners. Features change; confirm details on the official website.