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

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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

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

File metadata

  • Download URL: clang_format-18.1.4.tar.gz
  • Upload date:
  • Size: 11.1 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.4.tar.gz
Algorithm Hash digest
SHA256 dfbaee806bd55f5f558abaca44dccf7c7ee1325aa4c247fcb53f49ae5520f726
MD5 cd1f4b25c0014698d0920290a8931bec
BLAKE2b-256 0df82fc32fe9229f0bf40c00ede9f531c7364a357215b6dfffdb077b2a19b668

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 857f20cdb2329b73d042e1660550a16aa02dba8cb7cde6311e27bf167b203c8d
MD5 639a935d987a06457988faffaca69bf5
BLAKE2b-256 35fde95ad7c22fca27d80d65f8629d30c1db194237e61349886befadabfb2e39

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 010b09f8b6b6bd9d6d55e1fcec271d34db5a4dd267b4b6007475be5351f8c12e
MD5 0febb5f6e478339e19bcde9dda4ec70c
BLAKE2b-256 34f66afaedeca52adb8cd2e8dcc8621fafd131d0720e5d7b83c6ed7dd2acfb8e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 e263024fdd6fb9ea94b828523b46383496fd28effac00190b334f5d196b75c26
MD5 90d9ab6ffa843a2f7626de847a20bc4a
BLAKE2b-256 bca53ce0eca8336b37a02343d2367891c79bc4ce5b82c9e2dbf0da7510e4db32

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 f60cf5c39f2ede18ff80b9732c92ef6e00e824d74e9dafc7f67290902403bc9b
MD5 eae7c0439f089bce8ca8ef01a72f5055
BLAKE2b-256 83a7e64b24bf983c350aa16b270b8378d993c7e5c24efcec758abaa6a7dd62b4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 51e22398c2a8b8400dff7a504d5c3f80415744492a84a7ca8731619d927f0a54
MD5 4edb9fdb33707670ddb360f29af2e7ec
BLAKE2b-256 62acc7ef94fa31b9dcd35d38c9e52168acf5c5c42f50fd77f984f28717c6823d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 fa3a7e1bbed5ff5671a6fec12c18f0427a9a0b335a5aeb7c21d2bafac23cd422
MD5 2024cc6e020f8a243de22ecb58736c62
BLAKE2b-256 245c023b68cafadb544c22cc2608deb024301d3aea0e2c0c67bed4375c58d8dd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 fcea63563927b0a5afae40b09df35368f782f6fb988533423fe60941f42f85fe
MD5 e0842bb65137b83b2d61e14cd0563ab9
BLAKE2b-256 12d45329f52c3da7211e3126f874bb25fe2cabeee029747ef27867031a6fb640

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e698e687ccff2014bc82ca9e1046ec271f23f89746b339375a7ee0109dd71ed
MD5 54dc913e02861b7937b2c312dcb34181
BLAKE2b-256 40c14bb1de40fe33130ff66e46153b94aba90a08f5a913162c3fdc9304bb586b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 248d5dbe035438dbd2b3d6b02b01895c5a5c8945c44391b0042b52d87b82a934
MD5 9d5c71dc2ad56d80b1de0cd8306789a8
BLAKE2b-256 1e99fb9df84185dda85d904ed6703d6509e5ed0b5d6d0b6e3f4dfa35546868eb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 cb6d3107195c95235a7f78e4a6ae70be8611e6abc7798dfef8f3eae59e4d66bb
MD5 b060b5a58f19f450aee5c4ff0424c615
BLAKE2b-256 1c18b9648401f0164bcfd91d7afc0a3168af267986c7b3c1effb3f332c1f06df

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 c697fa3dd6de8727e223701ebe022a1a8486b44f9e5d3ff696908a48c4ee6525
MD5 89731907bcc68acdbe962149abf8858f
BLAKE2b-256 32438f5a645518440ffc450cfd43bf6abf7e73d3e9c6b58febfa39c99ee1737e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ff470247c5574c6ddfe74c4e6e1e73456cd46cc015f7f11a634d0f8644996d7d
MD5 c64001b6ecc8a53eb5c8257d19198a2b
BLAKE2b-256 4170fdf29b32116aa9b291f3d5e0e0f8fc461bc74b0ca849de13a4a6e0cde673

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2441fb6623c684a25b973aae8ac20714ee65abbd1911479a5792d7c542e80063
MD5 c6e8099f5aaa1999fb0206cbec1881c1
BLAKE2b-256 3f8677ff39a267ce7d666e8ef3ad9a4e6ea63805bae96dda8417d77f930af671

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.4-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1c1ecbcb3e0d43b73225317847d32801745a7b5b2343e1e5fbb2d44e2320d4f8
MD5 9bd539a88e992a6c624716af88d9c0e7
BLAKE2b-256 e66e9f0bce8867f5ed6fc676bc6dbfeb0fe14ae8dc8d79412131701eb5ee715a

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