C/C++ Linting Package¶
A package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of
Warning
This project is still experimental and subject to drastic changes. Please use the pure python cpp-linter package until this project is ready for deployment.
Install¶
This package is available in several programming languages (through their respective package managers).
Rust¶
Install from source code hosted at crates.io:
cargo install cpp-linter
Install a pre-compiled binary from GitHub releases:
First install cargo-binstall
.
cargo binstall cpp-linter
Python¶
Install the python package:
pip install cpp-linter
Pre-releases are uploaded to test-pypi:
pip install -i https://test.pypi.org/simple/ cpp-linter
Node.js¶
Install the Node.js binding:
npm -g install @cpp-linter/cpp-linter
Usage¶
For usage in a CI workflow, see the cpp-linter/cpp-linter-action repository.
For the description of supported Command Line Interface options, see the CLI documentation.
Example¶
Annotations¶
Using --file-annotations
:
clang-format annotations¶
clang-tidy annotations¶
Thread Comment¶
Using --thread-comments
:
Step Summary¶
Using --step-summary
:
Pull Request Review¶
Only clang-tidy¶
Using --tidy-review
:
Only clang-format¶
Using --format-review
:
Have question or feedback?¶
To provide feedback (requesting a feature or reporting a bug) please post to issues.
License¶
The scripts and documentation in this project are released under the MIT.
Dependencies (that are redistributed by us in binary form) have the following license agreements:
- clap: Dual-licensed under Apache 2.0 or MIT.
- git2: Dual-licensed under Apache 2.0 or MIT.
The following are conditionally included in binaries (using the openssl-vendored
feature on a
case-by-case basis) because it is a dependency of git2:
- openssl: Licensed under Apache 2.0
-
openssl-probe: Dual-licensed under Apache 2.0 or MIT.
-
lenient_semver: Dual-licensed under Apache 2.0 or MIT.
- log: Dual-licensed under Apache 2.0 or MIT.
- regex: Dual-licensed under Apache 2.0 or MIT.
- reqwest: Dual-licensed under Apache 2.0 or MIT.
- semver: Dual-licensed under Apache 2.0 or MIT.
- serde: Dual-licensed under Apache 2.0 or MIT.
- serde-xml-rs: Licensed under MIT.
- serde_json: Dual-licensed under Apache 2.0 or MIT.
- which: Licensed under MIT.
- tokio: Licensed under MIT.
- futures: Dual-licensed under Apache 2.0 or MIT.
- chrono: Dual-licensed under Apache 2.0 or MIT.
- colored: Licensed under MPL-2.0
The python binding uses
- pyo3: Dual-licensed under Apache 2.0 or MIT.
The node binding uses
- napi: Licensed under MIT
- napi-derive: Licensed under MIT