Clang-Format is an LLVM-based code formatting tool
Project description
clang-format Python distribution
This project packages the clang-format
utility as a Python package. It allows you to install clang-format
directly from PyPI:
python -m pip install clang-format
This projects intends to release a new PyPI package for each major and minor release of clang-format
.
Use with pipx
You can use pipx
to run clang-format, as well. For example, pipx run clang-format <args>
will run clang-format 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
).
Use from pre-commit
A pre-commit hook is also provided, use like this:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.0
hooks:
- id: clang-format
In contrast to many other pre-commit hooks, the versioning of the hook matches the versioning of clang-format
.
You can choose any released minor version of LLVM >= 10.
Building new releases
The clang-format-wheel repository provides the logic to build and publish binary wheels of the clang-format
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"0"
)deploy_to_testpypi
: Whether to deploy to TestPyPI instead of PyPI (default:false
)
The repository with the precommit hook is automatically updated using a scheduled Github Actions workflow.
Acknowledgments
This repository extends the great work of several other projects:
clang-format
itself is provided by the LLVM project under the Apache 2.0 License with LLVM exceptions.- The build logic is based on scikit-build which greatly reduces the amount of low level code necessary to package
clang-format
. - The
scikit-build
packaging examples of CMake and Ninja were very helpful in packagingclang-format
. - The CI build process is controlled by cibuildwheel which makes building wheels across a number of platforms a pleasant experience (!)
Special thanks goes to mgevaert who initiated this project and maintained it until 2021.
We are grateful for the generous provisioning with CI resources that GitHub currently offers to Open Source projects.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for clang_format-11.0.1.1-py2.py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f3cbd3fe116295a02163cb7a188144a72d97587f14daaf8b152db3889920af6 |
|
MD5 | 141dfd189bea45d2147a7ef8149ac6fd |
|
BLAKE2b-256 | b728e7519e2754f41dd64db5491cae7df47dec08a4617101dac94496dc32dc7d |
Hashes for clang_format-11.0.1.1-py2.py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c120fe194a9d16f451e30e2279ffa2394cca05e97e339d4a356b8f3b2a99ef7 |
|
MD5 | d193e9b653fd0899ebf0584eb1ed1098 |
|
BLAKE2b-256 | 6581aba3b46668c8c1fd150343275a2d26a6b3010372249a26cf848ff08613f3 |
Hashes for clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b52261c86436870a7385a4bba513570629a04d1a0cdd2fe5561ea56972224cf5 |
|
MD5 | 55ab6e39687f6a175842bbb3fa19df78 |
|
BLAKE2b-256 | 3c62256f565ad6c672e7f130f7ced7b3f257571ed03367c13304ba867ef682c8 |
Hashes for clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a34b43f416d55e67710caee4641b2be4d514f559884edd21db432da51bbf881 |
|
MD5 | 97d98ab3125e4c2dff04b26b44654252 |
|
BLAKE2b-256 | 2173f8808e3751ed490d1c2524403b05d7bbe3efb34b1b86564f058650de1fa3 |
Hashes for clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 197c63fca53608114a54c1a0d0dc822513cfd8ed6129184ee7c46d570e12e0c2 |
|
MD5 | daca5d0db8cc3a78feb750a6639ac056 |
|
BLAKE2b-256 | 07a2a5ec8aaa841901d31f44b46e69ce38eb954f98dca7c7e1a6d5f5025948b3 |
Hashes for clang_format-11.0.1.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 022eec1067db92375e1c031059f5202309e9b458d30fd694c69c0da33e1b17f4 |
|
MD5 | b68fe7d9631dc888af7f71849826f4fd |
|
BLAKE2b-256 | 9b5c71a87be95e73097f2103843206d5ea9637692638c0877fe19877facde6c9 |
Hashes for clang_format-11.0.1.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f35614c66e848f584bee67b65611849a2188103d8f155229eb5bcd3516b92f1 |
|
MD5 | c40b82f2bc5974bc567e854e0f179542 |
|
BLAKE2b-256 | 10253e158143713530d888fb91da6765b602a11dc0b92837155f5f1e1b8b88e8 |
Hashes for clang_format-11.0.1.1-py2.py3-none-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a0ea9807703fc30ed3bd2380258aa6f20ed43da0bab5365e952dbce9537025a |
|
MD5 | db41ac46223b64f02ba1266e22e909eb |
|
BLAKE2b-256 | 03df347ae0aec365dc9431fdbacd059855e8988f608757c8241a6d26f0b44370 |