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.4
  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.4.tar.gz (11.1 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

clang_format-19.1.4-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.4-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.4-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.4-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.4-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.4-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.4-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.4-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.4-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.4-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.4-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.4-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.4.tar.gz.

File metadata

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

File hashes

Hashes for clang_format-19.1.4.tar.gz
Algorithm Hash digest
SHA256 03c46d4c728cccfa3ede2ae0998260f206f5590966bcf84beaa3223fc7165f6c
MD5 b044d104fb4763cff526f1dc4b6649e7
BLAKE2b-256 f791d72a202ab605be764291e56bb243a1651df693f318879aecb114d2922538

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 66385c7d8ef28897f52bf3107786bf44bbb8f61848592d115459217cc56f39e5
MD5 87a154cfd5564267d68dcdc5a56e77a1
BLAKE2b-256 9eb1bc767d6873141a69d07fa68031d359bb1b27dd626b068b107e410b23e75b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 ba7d361a8f93866a8320182188f93bb8a765cdac4a99006262a81aabff22bb72
MD5 90762e58b91b628cf4374b7b73abc0e1
BLAKE2b-256 52b628175c4a9adb96a80786e749eb73effff1a56c7e19df4684d70ca2655c4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 991e80afe974e13ebfa560ca3c9cd14ca725cf65bde861331f070b92f5b3f830
MD5 ad85e164c1aff94883ddeaa3472c9749
BLAKE2b-256 fd8860e19b71723afd5a7786fa1f0002f690dec393708cffb775fd631764549f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-musllinux_1_2_s390x.whl
Algorithm Hash digest
SHA256 ccf6764d1193102d06bdd552fa3f02a73f6a6122b6d27de99a3b151c12578be9
MD5 56028354de9017c6f371f53dc332eb29
BLAKE2b-256 fa2c8efa425960ad5087b01a089b9384efb1c76a396852bc2d423fe89c93e1c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-musllinux_1_2_ppc64le.whl
Algorithm Hash digest
SHA256 8cea3c57593beb3426348edbc89a57df938818fc369f5768fbcb12f60e15a8e3
MD5 6de748ddbc62d04cfd69f8b01e055eb0
BLAKE2b-256 b3373ec6fab9ea2dcf61e6de5c7fc2ee14987cb5115518bb279dcc58812142ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 2f6c37e1e201ec86b880b7b581b981dcf4f0cc45cdd2e59d67d883ed85a5b664
MD5 fbaa358a1901dae1951dd8ceb991ddad
BLAKE2b-256 0763137ad026d2faae47b680c3541ece385bcc4c800c0350d79d1f00e1bf3f71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 6518c8f60d110e690ce9b9f4ceafb4dbc1e9f376c567e3590080aaea7eb0dc36
MD5 4e772ded90d2f1a3381279a20aa25c81
BLAKE2b-256 03298f3adbfcc39d25448bbe9e48702dd3b59b26292dbaf41e42d6af341e446a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a6e5a15a5160d2927004fed4a3ce1ee0cd0f546e3a71a96a09ca88f431d7d8d2
MD5 ecb3bf600d00a9d89a53d39d53ae2b44
BLAKE2b-256 9a0b8012cb9ee1df999e16807cd18d69a2a92f9d72fcf980f88929323989d78a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 089d7b2062aceecdd6042036d6b8a2b91e481c6348f9be78acd94afad8f22f8f
MD5 fee0f62aa877ad8a2cc9b8c3faa4fa64
BLAKE2b-256 20e8ef483f7d31d9b6607aa4d82c450462992ab085f606b67e98f8af666cc9ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 0607af9d40edb9f6f762132dacbc033d4e3b80263a49c25790fd81693413f207
MD5 29e10420ecf6dacc764c1404f63c765a
BLAKE2b-256 61bc878a507a33d2fe543078f9aea9fc682d3f92af481354302786c5f43b4ead

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 249c550ae6a9b342174eb918147a2a9d2af735b8a07736917f5a19742437e98e
MD5 d766a2c94cd4e2f4c1a9a52e4757bfe1
BLAKE2b-256 4cdc772f9f42c305468fff4f9bad5fa43850d4dddf6711e9caef8884e8ae3a5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 026835a229022e2b5188811d0cdd2361e7abf8515ad5b6d23c6d4982f6a7bbdb
MD5 b70b0ada53a3e1f5513be08dc777c5a1
BLAKE2b-256 8bf665fc5bcd6b741178f18ee5d629fed48c305218c81cf05408d66177433672

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65d03aedff6e056ada784f95e85a94e1fbf265c54cc4c4d53832c609996de541
MD5 cbb14d345e71d23981760317d778bfd8
BLAKE2b-256 77044a0c30c41eadb06006027d1b05e5594b1bb440caea60defbad4d375c7d46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.4-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 06b05e745bea7e032ffc819c821a3a8d3f0425a09b44b3375997e7f5eb1beba7
MD5 6c626fbcc4c4b7926cd891be19743f40
BLAKE2b-256 2a7ba57ab80480a31b4f7b242aa86fb2ad9bb70e77cbfd298be7909deeda2880

See more details on using hashes here.

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