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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

clang_format-19.1.0-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.0-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.0-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.0-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.0-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.0-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.0-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.0-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.0-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.0-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.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: clang_format-19.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 4a092cd776b75f959e1e0b36457ff0b9d0725b73fb693f7133501f1ef80bc5b3
MD5 14c00bd5f74e0bcfc1c2399cf7252a3e
BLAKE2b-256 33713ae44cd87aee3607761b3b9ca7dce246c25352d7240aad75f45f703f0108

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d1dd44d521c050fc4c384f6790e4b9b819da62fe0d05b9b0083a45962a0cddf6
MD5 0b64c1cb2c904459d22aef2d58204640
BLAKE2b-256 574ced8d70c1612bae92166e656fb248366120fdf86132001c152f1db634b9ac

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 703862fab62adc7282edcf4c8a2dff45cc9adcbbf1a282f3a9a02046f58d0b0f
MD5 a79f08f9e059eb86974a2a7a6076e681
BLAKE2b-256 a1a32e813a0983299f78f00e824a475a10db1dfb65671e2f32fdf4a86449404e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5bb6b077f3735f7d40ad6e854e672928a31d33ff92415b580f47d217e6315d3b
MD5 b8dcdc6bc6a298ee1fa1dc7184e4d942
BLAKE2b-256 1de9fc0497e29c31c82ecac327fe5e032cc7db445010041e0136b4cb3e5726ae

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-musllinux_1_2_s390x.whl
Algorithm Hash digest
SHA256 6dab0a9913fcfc8def9373c810e8aa74854ad02932c68bb7110bc95f31701910
MD5 969cec28fcd7db8e72bb3293efbf0f16
BLAKE2b-256 88efb1681f446a9f6495cd914d621ac54f43370f0e97e8de401a16e6e731a20a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-musllinux_1_2_ppc64le.whl
Algorithm Hash digest
SHA256 1e9d1b9e85cd8ea1c3b0b4b44d09d5acb1953da50a32ad05f9c05bcecc176f19
MD5 e971679633443ea2b1d9ea0530e14f32
BLAKE2b-256 4ab538ae8d57b4e8d6e926845d65406389603755624be6621ce4fa65f0bfb9cd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 5aed51234bf29e27c0de24310408f185cca0f5042c9e0b0c1180dab7bcb049e7
MD5 429b7c19c974f0f4be98fda04a56cdfa
BLAKE2b-256 6ebe294b20f292340b5d22def736226b3efd9273d4f59910729aa348b93226ad

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 062cfce06656fc34e35286c8ab0dd49b8866f154ac1f086891305a3dec047fbb
MD5 618b69c09b52f9c482bca973f93911ca
BLAKE2b-256 68fe60925f9ca41e1a3769926c9236b3f2a5887c2795c773f2878ec1c117f7ae

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b4074f5ac8f085b465b61b088dd08fafaef226dc3f0ac7b67596ff2c1ad881e4
MD5 f69876caab94583cd96ac84af6085dc9
BLAKE2b-256 cd892188cba69c7add8cbd49d3d303434bf3c51fe75d44922da13c3bb82ca947

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 84206110f071b641458d6fa0f54ae71386f4d308cd870b8cf95efff5f4837efc
MD5 615e6f0f94347d4016c2c8ca707edf1f
BLAKE2b-256 05259b6c8470c653326f66588c0153498997e51e3dcb45bb57130afc5c74c21c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 18903cf0600a372973cdffa55959613f4efecffadd6b4e6316787382e9633120
MD5 ef2c671e94dc60d061b1c48fafd9b3d1
BLAKE2b-256 48d1c1b1d51a8b73544ca36d0a689f66564e1c6e3562e5c759db94bc16f70aee

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ceea5abecf0c5e12f6216630f8485903e9d46fe8ca25b2b213c096c2563aa1fe
MD5 015ccb68b59c406da5d5809c80c55886
BLAKE2b-256 0c2e86633031d29e3fbb28a52cf7ffbb51150d4b6b6a55615d6ea2464922b6f6

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 86f6b8bcf208e1bab74de386258598f3d84874b6564ab62b76e2fb75c5656382
MD5 b3daf23250e5fe508381f572a88ee0df
BLAKE2b-256 703f30404b6ce44810019516d7e7a7ee23ba245f437d55511cc43c143085cc7c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6671890aba498b8eee733ed600db244e27cb9e8a423467a29d367d58c0e30a13
MD5 d76cd6dd808c7fec5e8745ceedd931ea
BLAKE2b-256 877547d0afda6fe55de246dc1e8770fc855add13b4f6c326e3358ed89f7d63af

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.0-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6f841eb89014e1e7a5cc45f2e43e5ddd87b2172b95ca550b1c4b9827921f09eb
MD5 2aa4afa87f0e60ebb5e50628cb999c28
BLAKE2b-256 f810d1653531394a6421ff080216d7541cd6fa62e43fed45aac7c20f2e9424a0

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