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: v18.1.5
  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-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-18.1.5.tar.gz (11.0 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

clang_format-18.1.5-py2.py3-none-musllinux_1_1_x86_64.whl (2.2 MB view details)

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

clang_format-18.1.5-py2.py3-none-musllinux_1_1_s390x.whl (2.2 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ s390x

clang_format-18.1.5-py2.py3-none-musllinux_1_1_ppc64le.whl (2.5 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ ppc64le

clang_format-18.1.5-py2.py3-none-musllinux_1_1_i686.whl (2.4 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ i686

clang_format-18.1.5-py2.py3-none-musllinux_1_1_aarch64.whl (2.2 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ ARM64

clang_format-18.1.5-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-18.1.5-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-18.1.5-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-18.1.5-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-18.1.5-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-18.1.5-py2.py3-none-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded Python 2 Python 3 macOS 11.0+ ARM64

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

File metadata

  • Download URL: clang_format-18.1.5.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for clang_format-18.1.5.tar.gz
Algorithm Hash digest
SHA256 08ad8c9758a4437b53946171f8bd047879873de72916111c88ec9895af916a45
MD5 59d34af49e90869ef48126ca177ef34b
BLAKE2b-256 27ccbf051d3fd7f37a9a5411b8d5f714f1cec545b5a36dc8147b40d840ab1271

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 dce69f0acdf3235e1576421b785e6aef1eb5a0d8160eb66c6a1937d80dff4e0a
MD5 49b303549ffa0099e18f50d46302536b
BLAKE2b-256 e600877ca0402fa21a831e267de58ae66dd9811545e55c7c005a90db2cc57fc4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 6715ca55933e8a7d7ef1ea3d8f546f304827f5cc21aae4c55243fce9c235327c
MD5 974ffb508dd1a37bc982aa77dd16dc37
BLAKE2b-256 3dac2eab336c56229155d2cc667b9ab7eead58c7e17908037b7f5a2bceb9519f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1ba15db2b5bef77b010df06e8b0c02b5b817cedef58026f32f9e51c659510271
MD5 ab72239a07c8d6ced229e7286f735e89
BLAKE2b-256 74384edbec3fc071a9976484937379519da990cf6b4e5e856ac2bbf02da89f38

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 d60be8b694f1377597ec861c16e2863248ce3f41546ac8ea308568ba0859ef97
MD5 838071eae09cd75bebb79bc1eb93bd89
BLAKE2b-256 194103ac684e87cbd377967458f69f078a62b7314b2ff6af2b9c436b7b70639a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 27085485fd3a45baf7b42f2bbfe7521a49cc154566cd22396c5288c8fc354bc2
MD5 ec26f7bcdab9a3b4d1f68eb4cd699243
BLAKE2b-256 26797a9dd87813661eecdf40906d741b3a2d22fee625c665d0072c6526648b80

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 1bcdfbdaa64b9913a8ffac9b7e2619747981d3ab61296469ca9b230b8af1121b
MD5 0a48bfa983edd81a2424718fa05f02c1
BLAKE2b-256 fd981623cf5bd05addab572655f56316683ae7887abaaca2ba6f47c4fa5c0db8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 1d9b4d145a5f4bde36543456d041c07860c65b533a923ccccdaa31e49a96532a
MD5 99f3d4ee544033f65120c7cabcef828c
BLAKE2b-256 764b8bbef67fd4596bc57e1c89a38d1dad8b1b2530f343870e6a6377c8d53b23

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4ff65740e0eb6171a4de9a95a3f9fa56d2d257355995a944ad367b790470b706
MD5 5e667c31344708165201e8df0aead1dd
BLAKE2b-256 4596d960d9add3eb71f6c6039181054281aeb42f2cb4877a33f889516abc2cb4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 d3eafd9eb0cb8e6ec04695d84555bb2b837bae6aa0a5b53f1c8f98dee548bb95
MD5 3fe33c4fc9f58888b030b0fa4cd2b085
BLAKE2b-256 31c97111ca748e2e41cf4e0cdabbf005b797eb9bb5211d032f07541678b9e179

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 d51e03f9a1d23148937d41fe29e12230792e1fe0cf8bff84c043cc78fdf0add2
MD5 b4cfa4104c0e498c82760bf876850750
BLAKE2b-256 c7ed9fe524850def76290775058fd6e966e6554b10e410ccc89dd70f9ec615ca

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4752b130eb76e5a4e4ee70845fc4123ea5d4dfa297c0d181c5ffee408791e953
MD5 1c7cc1af91f6c15c5458304338e99e6a
BLAKE2b-256 1f8884019dc24bee1fc070d9201b1e584ead0a1c8a0cc583439738933dd50829

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6e1978aaddca1d762b2e2d65e2fe6210e0bfb565755fb27ab4ba2274ff113426
MD5 70bf01c041e36bc520c73ffe771b8c2c
BLAKE2b-256 d41a0c00bbd56da200338d39303384775d4a4283971030d70f431a7024203fb3

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c1eb9a19a4f1c31a761b3208131b4216b6ca5c8be2bc88a73319d229106f066e
MD5 a456141b2dea851e377a51ab8643ba1a
BLAKE2b-256 59507dd66afdf04eca035559bcdc8a20f1f1d868f8ea2fad27e592c63580a8e5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.5-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 306fe4effef3f737d7f6ed3b6feec050d31e749a4cf82a9738e33eb658b12eca
MD5 2026c43d865ecbaec813207b626e271d
BLAKE2b-256 b6c65cf11a2097f41c6472dc00ec49dd0681dd31ff12840e937eb30a3125b33b

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