Skip to main content

Clang-Format is an LLVM-based code formatting tool

Project description

clang-format Python distribution

PyPI Release

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: v19.1.1
  hooks:
  - id: clang-format
    types_or: [c++, c, cuda]

In contrast to many other pre-commit hooks, the versioning of the hook matches the versioning of clang-format.

If you are required to stick with a given major/minor version of clang-format with your pre-commit-hook, you can use this alternative hook repository that also receives backports of older versions of clang-format. Currently, all major/minor versions of LLVM >= 10 are supported. It is best to subscribe to releases of the hook repository to get notified of new backport releases, as pre-commit's auto-upgrade functionality will not work in that case.

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:

Alternatively, the workflow can be triggered manually:

On manual triggers, the following input variables are available:

  • llvm_version: Override the LLVM version (default: "")
  • wheel_version: Override the wheel packaging version (default "0")
  • skip_emulation: Set which emulation builds to skip, e.g. "qemu" (default: "")
  • 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.

Acknowledgements

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-core 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 packaging clang-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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clang_format-19.1.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distributions

clang_format-19.1.1-py2.py3-none-win_amd64.whl (1.4 MB view details)

Uploaded Python 2 Python 3 Windows x86-64

clang_format-19.1.1-py2.py3-none-win32.whl (1.2 MB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-19.1.1-py2.py3-none-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ x86-64

clang_format-19.1.1-py2.py3-none-musllinux_1_2_s390x.whl (3.1 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ s390x

clang_format-19.1.1-py2.py3-none-musllinux_1_2_ppc64le.whl (3.1 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ ppc64le

clang_format-19.1.1-py2.py3-none-musllinux_1_2_i686.whl (3.0 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ i686

clang_format-19.1.1-py2.py3-none-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ ARM64

clang_format-19.1.1-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ x86-64

clang_format-19.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.7 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

clang_format-19.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.6 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

clang_format-19.1.1-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (1.9 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ i686

clang_format-19.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ARM64

clang_format-19.1.1-py2.py3-none-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded Python 2 Python 3 macOS 11.0+ ARM64

clang_format-19.1.1-py2.py3-none-macosx_10_9_x86_64.whl (1.4 MB view details)

Uploaded Python 2 Python 3 macOS 10.9+ x86-64

File details

Details for the file clang_format-19.1.1.tar.gz.

File metadata

  • Download URL: clang_format-19.1.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for clang_format-19.1.1.tar.gz
Algorithm Hash digest
SHA256 aeb3a1898ee86689602d583da3dcbd2f6cdf460538c2d7a3623a5012132ada1b
MD5 97f12a8634377bd4da75d9c1d5e41dff
BLAKE2b-256 4d33d91b271285c0f936f9af3e3fd16cd165a448a95a7c5662439cb936615d93

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 631aa55a56f96f12d9c6060fb6d09f397f32705c7a4331e1944a107f6c99f139
MD5 05402c40af8c93c6ac29dfde9b497851
BLAKE2b-256 896ece69b88264d8e00712262401e2d72957f20bb609c523cd7bdfc3b96fc83a

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-win32.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 6e67c7aa81cea8161db3d3654331103225104ad7622257b4f4e00f8563aced52
MD5 14cf3ba5fb34fce643a42716459d2d4b
BLAKE2b-256 37bc308e7a42996cbe3891988420e3e58662504ac5ce7d9d41dd182b3a9733a0

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7dc424c87b53d6097e46df034a5359ed9d1932ec5dccd0ab42f1ef3655a7452f
MD5 62551578c481bbb1cc7e827f35250529
BLAKE2b-256 3a724f9a98c3d46eabb850636a19b7d2e34f0170a8301cc7e892b2774d8f4426

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-musllinux_1_2_s390x.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-musllinux_1_2_s390x.whl
Algorithm Hash digest
SHA256 39bca9a96498c674cc765d572ed299e80373e3c33f73961786864bd516b1eeb7
MD5 f4671d9d471de974c130155684db9453
BLAKE2b-256 43049d2fc8faa9872147cbe388d6dc88a00c93846e797255dc611c9aa52015fa

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-musllinux_1_2_ppc64le.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-musllinux_1_2_ppc64le.whl
Algorithm Hash digest
SHA256 380c724ae53658ad51b0f6a2bd88677ac051cf5d3d55c7874ba2c0bed3cfe1e9
MD5 eb8b5777cac7fb597be6a87cf6105a4f
BLAKE2b-256 ac9ccf71710c0fc32c11d3e0c94c55293fc9bf13a00bcb85c03d710d94193d1b

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 c4218faed21065d28d33420e756a9ef74cb60b53d80c101fd1770f2ac2198492
MD5 c01e1a8cc42ea83a36261c86311d1566
BLAKE2b-256 731129d96d01d8d841be9e1dd3a0816f34ad543fb9ddf8bb3260ad9c526abd22

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 3e9644587d44f5700e5b5c668ffa81b20575c83e971e07f5e512aae421cde387
MD5 07bbf551cd3046bc65d0923157233cc9
BLAKE2b-256 eafff83e1daa7b85284b7ea72e5e2f74e3cee8a56ba78d08c53d9720e3900a42

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0aa0b5faf59224591b72e90284e28a6054c6bf78869fb9b49f8fbf5da40fcfbf
MD5 83b1e21f427864259a7baa4962e799f3
BLAKE2b-256 0ecf6b40e09d5447c5eb75ae11a90ce992953ee97d075a200d3a878f5f10aec1

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 656460de9afadb918261da115bb3ccf8023da2729c27670a7eadb1e1225c65a8
MD5 80cd7885b9bec791584f3bcf603ef532
BLAKE2b-256 8bd359f7c0d1873754a49a3ef956748aa7b2a00527e70422e9648c66d116ff66

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 4d6a533ff6def4b5729bfa4edaaa1015c7058ed218b4e0280c980c4ec5bdd47c
MD5 db42a5ad0b4317515682ede843a02aa8
BLAKE2b-256 1ef7ced95c7f33d2e53ff9c278c6d9da23736c13a49b213207989cd3cba3645c

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 8e571b591fd42afa6974a79cc162ac4946bcf4e0050f4f46ecb232b90526e540
MD5 0bbfb3a93177f8633d0d280252df633d
BLAKE2b-256 cda4527619a6ea15e18a6812aa755b66f8d10626483f39b3afe167144b409984

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 28f37d5ddd799a0e62dfdad5f13cb065103d89a71a0b6e9f92d0282dd7055d4c
MD5 a5586dd34ef2f4232ecb2f247bccb005
BLAKE2b-256 be396b1915d39537eaece3979561c0f981463339e7f5daad9d0e0071e6cafd12

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d4ae63766cffcff4a55640b92210b0bdc0d7d9a5d9d9e0a8a998e532c204017a
MD5 0d5ca4fe855925d4d7086932d16a9364
BLAKE2b-256 916befb38cf48b42974c4f179293c8b9c69543fa2f83aafee05ffaee6141a9b3

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-19.1.1-py2.py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.1-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e4967d43c986ce5987d293705ed5b76f44db71fdd111ea365dcaabc7a3c4f237
MD5 a794dfaa5cca25efabf393d4a6790570
BLAKE2b-256 065d2f346927c905d7092671cd57f30dcbabb8f8f514e4bb3a081cc7732ef53b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page