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: v16.0.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:

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.

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

Uploaded Source

Built Distributions

clang_format-16.0.1-py2.py3-none-win_amd64.whl (1.3 MB view details)

Uploaded Python 2 Python 3 Windows x86-64

clang_format-16.0.1-py2.py3-none-win32.whl (1.1 MB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-16.0.1-py2.py3-none-musllinux_1_1_x86_64.whl (2.1 MB view details)

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

clang_format-16.0.1-py2.py3-none-musllinux_1_1_s390x.whl (2.1 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ s390x

clang_format-16.0.1-py2.py3-none-musllinux_1_1_ppc64le.whl (2.4 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ ppc64le

clang_format-16.0.1-py2.py3-none-musllinux_1_1_i686.whl (2.3 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ i686

clang_format-16.0.1-py2.py3-none-musllinux_1_1_aarch64.whl (2.1 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ ARM64

clang_format-16.0.1-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

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

clang_format-16.0.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.6 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

clang_format-16.0.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.4 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

clang_format-16.0.1-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (1.8 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ i686

clang_format-16.0.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ARM64

clang_format-16.0.1-py2.py3-none-macosx_10_9_universal2.whl (2.5 MB view details)

Uploaded Python 2 Python 3 macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file clang-format-16.0.1.tar.gz.

File metadata

  • Download URL: clang-format-16.0.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for clang-format-16.0.1.tar.gz
Algorithm Hash digest
SHA256 e099be756ea229b2332324a5e17e96c2bbd2e3601c96a06d7265a2bc1ea81b52
MD5 de6febf92a8eda3c23b826f5942c3ca6
BLAKE2b-256 78289835c6e886f362df4ba6d3d06f759bbc3df70753435687510883d7770811

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5388169bfedf5c66b29cd34d077c80cc09e9bf8f0d948929835541f7de407417
MD5 81ba93fb3fe34de914012ff22c74fbb9
BLAKE2b-256 737df11894547de4688002aa2a9b71f736ad32715e8f1e36c5def6b008d28044

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 1718fcd34f382ef65b2137e65283c1ea300964ec7c8ff4ebef97945b797a2161
MD5 be59971da289528ac046658c97a7f5ff
BLAKE2b-256 cdd300274eda4ab820722bbe850dd431108e2a999d8b76baaf89b32844a6fc8e

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-16.0.1-py2.py3-none-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 8f58ac491899ca506851e5901efba4ada29a3f81fc8d95eaa74b24399eaadbc2
MD5 701fd3dad45a03a5f00c27db2dc0b82d
BLAKE2b-256 941572a37a2a38ccc100f0b5a41b9404da5da26690d4371ffff58be82f4611b3

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-16.0.1-py2.py3-none-musllinux_1_1_s390x.whl.

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 8570e08f43741b92c81690b26b5d0224f8782ab9f4db9965bb9c824a70adfd7e
MD5 acf3382a12684239b472921839745516
BLAKE2b-256 2ae6f376fb7c8168544c2c80a45c9bc28ce17da1352634004bc0d080b4577c41

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-16.0.1-py2.py3-none-musllinux_1_1_ppc64le.whl.

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 35a19ab7d20c17e7aad680b2d6893bc77f00b4b7fd52cae397fd55a229000569
MD5 bf40a216cf9ad1f03e1e6bf8b317b18c
BLAKE2b-256 b663504f4c46176622c32b5cccef4820cedd5eb9ec2c77480d6dddddf2361933

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-16.0.1-py2.py3-none-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 fa7a4854345fd0e73d5eb912cfad33afcf1570919e86db37c96c1820234cad23
MD5 a9a8165efed724d24bb025a0ce1a6910
BLAKE2b-256 d9931b33bf35bad99b4582c40060cf0d0e9ba648dd410be7954976e8731eedf9

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-16.0.1-py2.py3-none-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 4908418220d0fd1e5d11736ef52076cea3a847275be1146b4f30c1e2e147d23a
MD5 c06cd20eb375c41a9d263b6ef598b609
BLAKE2b-256 a81d8c6c8c87c7c7801257ed158bb60ddae10d9b7229e3bba4c12febd83401fd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a1fc7e317434c0efc4ee894f14a79c935149e0968c8f1cef6f444dbc78e9bfb5
MD5 e1265ec5093b6c182b13e3f65f92fc3c
BLAKE2b-256 e5514a3635d36b7477d2a9fc22da7687877e19cf8e444f40a0d5b4fb2dd428fc

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 6e53ac10e03e07b33d28a17cf04898ccb281ad1b869a59b5a8588754c67d1a6c
MD5 15ed16f64c84ee940ec6c056f76bda9f
BLAKE2b-256 90f1ea21216ca5339d98b693511e131d39c5b5ff70c00906e0dfb87a195f8521

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 bb7344b869aa18880d2aa3e289e098a59f187de93fd5ece568f9142d08bae874
MD5 b3f37ed65506b1dbea4965324a17700f
BLAKE2b-256 43faeffd391f6d78765af285ef345c44ae9817abc28fbde281a6048ea4418fba

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 fadfbe00365e8c116778faa99e8131df56fe002f62c7a60f939a91b065561fd4
MD5 79c2dccfdbf5b99fd8ebfb9ddad1c74a
BLAKE2b-256 37126b3ebed508b4e22d16b3fb00440961e77a5cf7490f43a6cd38fd0876b266

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dd7dc0f27fd98d771c11917881eaabd21e114b8fef9873287818666b5be591f2
MD5 ef391073603f5abd70fa457ff77d76c3
BLAKE2b-256 05ac690183df982c057c9876abea8039e63438c27a1e03241d28ccd0f09a609f

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-16.0.1-py2.py3-none-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for clang_format-16.0.1-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bd0eeb36bdf92faf4596ae1d05f7ba00fa9e6b1a5673ed788a8a75ffcb1ba5fc
MD5 057ef0903488a29ea02ae554eaab4098
BLAKE2b-256 15275b33fd1bdb22c09a3d199085a3855ecaac8c7a2cf7f9c527a224553e1181

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