Clang-tidy is an LLVM-based code analyser tool
Actively maintained. Last release 5 weeks ago, commits in 6 of the last 26 weeks. A safe choice.
pip install clang-tidyclang-tidy Python distribution
This project packages the clang-tidy utility and related tools as a Python package. It allows you to install clang-tidy directly from PyPI:
python -m pip install clang-tidy
The tools provided are:
clang-tidy: lints C++ source code using configurable rulesclang-apply-replacements: applies "fixes" that have been exported byclang-tidyin YAML formatrun-clang-tidy.py: runsclang-tidyover all files in a compilation database or a specified path, with parallelismclang-tidy-diff.py: appliesclang-tidyto the changed lines in a user-provided diff
This projects intends to release a new PyPI package for each major and minor release of clang-tidy.
Use with pipx
You can use pipx to run clang-tidy, as well. For example, pipx run clang-tidy <args> will run clang-tidy without any previous install required on any machine with pipx (including all default GitHub Actions / Azure runners, avoiding requiring a pre-install step or even actions/setup-python).
Building new releases
The clang-tidy-wheel repository provides the logic to build and publish binary wheels of the clang-tidy utility.
In order to add a new release, the following steps are necessary:
- Edit the version file to reflect the new version.
- Make a GitHub release to trigger the GitHub Actions release workflow. Alternatively, the workflow can be triggered manually.
On manual triggers, the following input variables are available:
use_qemu: Whether to build targets that require emulation (default:true)llvm_version: Override the LLVM version (default:"")wheel_version: Override the wheel packaging version (default )