Cpplint is an actively maintained, open-source command-line tool for static analysis of C/C++ source files, primarily used to enforce adherence to Google's C++ style guide. Version 2.0.2 is the latest stable release, with frequent updates incorporating modern C++ standards and Python environment compatibility.
pip install cpplintNo compatibility data collected yet for this library.
The primary way to use cpplint is as a command-line tool. This example creates a C++ file, runs `cpplint` on it with a common filter to ignore line length, and prints the output. Note that `cpplint` writes its findings to stderr. Configuration can also be managed via a `CPPLINT.cfg` file in the project directory.
Upgrade your Python environment to 3.8 or later. The current minimum requirement is Python 3.9.
Remove any reliance on `python setup.py lint`. Instead, run `cpplint` directly from the command line with appropriate arguments.
If your project requires strict checking for non-const references, you may need to explicitly enable a corresponding filter if one becomes available, or consider this change in your style enforcement.
Customize linting rules using the `--filter` command-line option (e.g., `cpplint --filter=-whitespace/line_length`) or by creating a `CPPLINT.cfg` file in your project directory.
Use `// NOLINT(category)` comments on specific lines to suppress known false positives for particular categories. For blocks of code, use `// NOLINTBEGIN(category)` and `// NOLINTEND`.
Add the directory where `cpplint` is installed to your system's PATH environment variable. For example, on Linux, add `export PATH=$PATH:~/.local/bin/` to your `~/.bashrc` or `~/.zshrc` file and then `source` it.
Use a shell that performs wildcard expansion (like Git Bash or PowerShell) or explicitly list the files, or use a `for` loop in `cmd.exe`. For example, in PowerShell: `Get-ChildItem -Path . -Filter '*.cpp' -Recurse | ForEach-Object { cpplint $_.FullName }` or in `cmd.exe`: `for %f in (*.cpp) do cpplint %f`.Reorder your `#include` directives to match the specified order. If this specific check is problematic for your project's structure, you can disable it using the `--filter` option: `cpplint --filter=-build/include_order your_file.cpp`.
Configure the full path to the `cpplint` executable in your IDE's settings for the `cpplint` extension. For example, in VS Code, set `"cpplint.cpplintPath": "/home/your_username/.local/bin/cpplint"`.
Run `pip install cpplint` in your terminal to install the package.
No dependency data recorded yet.