Install clang-tools binaries (clang-format, clang-tidy) with pip.
Tip
It is recommended to use this package in a virtual environment.
# create the virtual env in the working directory python -m venv env-name # to activate on Linux: source env-name/bin/activate # to activate on Windows: ./env-name/Scripts/activate
This will ensure that
- there are no permission problems when installing the tool
- the installed path (for MacOS and Windows) is within the environment's variable
PATH
.
Install clang-tools command with pip
pip install clang-tools
Install clang-tools from git repo
pip install git+https://github.com/cpp-linter/clang-tools-pip.git@main
usage: clang-tools [-h] [-i INSTALL] [-d DIRECTORY] [-f] optional arguments: -h, --help show this help message and exit -i INSTALL, --install INSTALL Install clang-tools with specific version. default is 13. -d DIRECTORY, --directory DIRECTORY The directory where is the clang-tools install. -f Force overwriting the symlink to the installed binary. This will only overwrite an existing symlink.
Use clang-tools
command to install version 13 binaries.
clang-tools --install 13
Or install to a specified directory
clang-tools --install 13 --directory .
If the installed directory is in your path, you can run the installed tools.
clang-format-13 --version clang-format version 13.0.0
clang-tidy-13 --version LLVM (http://llvm.org/): LLVM version 13.0.0 Optimized build. Default target: x86_64-unknown-linux-gnu Host CPU: skylake
Version | 14 | 13 | 12.0.1 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3.9 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Linux | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Windows | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
macOS | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Version | 14 | 13 | 12.0.1 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3.9 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Linux | ❌ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Windows | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
macOS | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Know issues:
- clang-tidy-14 has Segmentation fault on Ubuntu 22.02.
- clang-format-14 is over 1 GB for MacOSX
Thanks to the project clang-tools-static-binaries for all the binaries.