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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

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

File metadata

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

File hashes

Hashes for clang_format-18.1.3.tar.gz
Algorithm Hash digest
SHA256 aaec391180391a64b71b28ebf34d97290dabaec4a5c5673247a67365581ebe21
MD5 11b2357c561c8dd1e69147c1327f7c25
BLAKE2b-256 8bac8224f71d132ebcd0c3119ce42a8ec1602582c659a387f843809830c2ffae

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b27f14d3ab4533de798bebd1480650a9d703d009d22e34caacc8b9bcc6b1cc2c
MD5 8ca5e786a7bb090e6aedd08591acaeec
BLAKE2b-256 a9dac9dc855e5e60783948eae03c56c0a48207a23462096e65343b03bff282c2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 5872234f561dd12d30e58f258b2e2583f297c958cd60a4473d29b67a4415bd92
MD5 a4a6f59fcf7b31dbacab6b71de2da135
BLAKE2b-256 0d154eced0f9a508a9f1c32c4ecf7cf819e5e230a72adcbeff6027098cfa7130

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 95f7ea59dd411f7e7322fbb28911b24df7fb96f3601d3d9f861c268d78244982
MD5 de2248f85fdb7617ebc24dc90add4995
BLAKE2b-256 2c3a81a17f28c13083979ea41d9d22f99ca6314f0fbf41fad59528153d2aff04

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 c260141f8c298b533a90ee43e324cfc1568d06fe768735924b9fda883c543629
MD5 f4d6c333099dc8b3529c735ee4718ef0
BLAKE2b-256 6cab7bd07106b38f305feafb7f9c8cf88970bd5410b8fa0fd4c0b96be519f8ab

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 0c36f88db93dc6519fb9382f0bdfc103427311cff59bb1333601a31a2fd8ed6c
MD5 a56b19500c7629cdb1e8cd2ddc66a240
BLAKE2b-256 af8f314460b0e5624f9899229f484e0e0f60bb69655679bbb680015c4f980e77

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 04bc6e61504bf82661ed3d18eed8a4de310bda249e79f170f648785f8479b8c5
MD5 8e8ae07c5d03115c5f52f90e860845fa
BLAKE2b-256 7479eebdd1f8b8ce187cf380abf0f5099e6e8e888e05ccf99c14ee15f840acab

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 185012029963f1296c6668dbd60a01c2799965ac3d497fbd12a7f00792310893
MD5 305471f491405c8a38d16202c5bd1860
BLAKE2b-256 a9a5a24386285fed687254f6e0b38ba7fa311f1ffa733465f9ee5d7771ee1244

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 059f2c2e7166f97cf06f78d9bd31d83a9c0416527845cb397296daa43bd2c6e2
MD5 7ddba497eb859bc3bceb996e1f0e0831
BLAKE2b-256 d59c4f3806d20397790b3cd80aef89d295bf399581804f5c5758b6207e54e902

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 9ea076cced01cb113d6abc30787f8ddc9dfcaf268dc6ba68766de6374b886131
MD5 2eb70dbf521bafde358157b59bcf7906
BLAKE2b-256 0d400351934d99d848cc22f11eaec73339c8a1132a534c430b770a07921fd07f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 9a2738f19309f0b4a25817ff95e3d89dd8859d33fd2516e6b419b3f00ff398f5
MD5 ee2aaace34bc574f3b805a8372dd1f98
BLAKE2b-256 b953fbea9cc2b69930b38a10708a18de1a30a08eb64a1a43777f62e5c11ce85d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5ab14e6c0fe4dcf054e6a07f284e0b93e272db449e4e5826ed6213e7b5282852
MD5 833c08772492916b486e1ef5737553f3
BLAKE2b-256 07fe0f4f7b9cf8590c0a917718d598fb6188e0978c02d604e5f22e45b6e693ac

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8df9358da6e9b007b7aabf9d800133d718d9bb641bbf10df19d4552ab9381708
MD5 1c6b7963b52cff5169a0b4f18ee73716
BLAKE2b-256 a708c1c8af9b2de7aca73a3b842509c5601d24dc83b9c4270050305f6251bb87

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d3e34907a422a22ec30cca09c8f967c1ddcbf3e8bf1a7120e651ef600b60f28
MD5 a8c51ebbb7042d12a60d9b059fd848f3
BLAKE2b-256 2cda1cf255be770ef669b1015a6cbb35c0d723b6ed2f5f5568b7ff4723075463

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.3-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fcc2635a4659aa482531c8573f52d0baacc13fed36182f89ae0b832d1bd5261d
MD5 7e21e8f228b0430a82ce0abc168ec494
BLAKE2b-256 c3fa316faca0c0171633b52d66b3dd37aae2c95788cbd3303482daccde398142

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