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: v17.0.6
  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-17.0.6.tar.gz (9.6 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

clang_format-17.0.6-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-17.0.6-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-17.0.6-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-17.0.6-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-17.0.6-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-17.0.6-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-17.0.6-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-17.0.6-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.5 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

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

Uploaded Python 2 Python 3 macOS 11.0+ ARM64

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

File metadata

  • Download URL: clang-format-17.0.6.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for clang-format-17.0.6.tar.gz
Algorithm Hash digest
SHA256 50f082840d2e013160355ed63add4502884344371dda5af12ec0abe68cbc5a36
MD5 ba3839b8ecf4400f55afe9180edd0b16
BLAKE2b-256 f9f50338054f3f749df62972445fa6ce3e303db27eac7aec4396fad6f67fc12b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9407f0f4cb5a26b96af38bb2261f1c4015127f4d87ce46a61bb3a3c2a3d4f3cc
MD5 820326eeb83a1f2453b43ec8cb035162
BLAKE2b-256 a143dd9dbd0191022ee1eeed7a48f3881f92abb68528f688f20a8659536ce8df

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 edd55b840fa6edcdafb1651c3c24c6ea8d911e73be30373e7e8e5741cb585464
MD5 1fdc404a4c1006328000f22546147361
BLAKE2b-256 685c58fd7a4e4191e41babc810f10ffbd2463f5fe6321e2ef02e0a72cacc3492

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 33c4f1975a6a0a76e5b85165c510c46ae1155f82477a5730e29799e43d78c83a
MD5 b28bc523f631907d28e8736907b0b70e
BLAKE2b-256 c48d46cf72600ea2cc9a34f98421102d180b9c1c1261dc8bb578611661edafef

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 afc29c4413b5f2f885347f4bdbb7fe81f595faeceafa640c9e67a2d9aa2c7134
MD5 9ae181c9bbfd15fa257eab78b856860e
BLAKE2b-256 2282fc884df02b5df4c045ac6c2e036080fade64c79fc7ce36c876ac7ce9feb0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 2ddc8b6237520d26d78489e3bb876243d87c3629eb3cd40e1df0c8c6e355d949
MD5 59f9a968da0eb1d47bc038783b2d4be8
BLAKE2b-256 8a450bc5f9557e3518097d851baf336ad98d89741155130a9754444df9832e26

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 a0f744b056cb1595efdb7d2b83a7d73370e506e17fcaa68cd884c2ed029ae0fd
MD5 a16b7f3b2ea70df1ad0f06419bd9dddb
BLAKE2b-256 74c0be7647e1c965af6a3946d6936abe826a4bd4f186d74e1f6dc657eb170fd7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 5476f8fba40e4330a4704681386d78751ced0ecbd050bd0687817cca01d4e167
MD5 f297c7998001c99146237b6fc46e0693
BLAKE2b-256 5ca24f49923502938302a099317a431cc1bce7d6516f30d2940fa096d7a9da93

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a1323ca5322e0dead521223155fe2ae1ba81d50abab8e20aaac28f6a94f23b9
MD5 f0f5847b992f61c8402ef8dea373c6d8
BLAKE2b-256 89df5296c3eca534eedef32813cd38b3436c86f0eabcda2238060f73e45ef37d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 ccb6f5ce90f24ed0bb314d041a8edcc94d1279c1469669d5855be004d9d6caff
MD5 d55d317ce0c00ad6887895fb8d577743
BLAKE2b-256 cc1df814e4f95552270a59da694cdaac1701540f03c5d8fcc4d90fb2536b5f3d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 393f896db6155d6b8401ebae40df1f9a8cdf15d494d13fb775657c9ec609b586
MD5 fbe8c68e5d8a6a200f76ab5a98d4e5b0
BLAKE2b-256 e4b58f84b52e2549d0058d37e06f2f3791bcab61fe88478a63417b5c44853105

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 879e831c58a25a9b7527155032a6dc4758716ded69590911468a37629acb13d1
MD5 f94b1c6c509b70b14782acb74a297219
BLAKE2b-256 079a84366548453da7debc318cef0f1a58a7c29379307f48a9f23dbe90b6758f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5cda40badfb01818ece739509d9cde678fc02660180cc1a55156782ef203704d
MD5 d21dbdf1356294517761dc7f21c23905
BLAKE2b-256 2ea578fe6b7b6947a1d90dcb451caf9c63895fa84d7fc453865a64d770aae242

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 195014a589fde9e2bec447ee1f2efd31f8c9f773b10aa66b510beae6997e6bc5
MD5 d213dfdf48ab34ee0bf5c6f2632fe630
BLAKE2b-256 5b0ad112aea9f0272e2c5558a2e9cf50229c846892dadf585f2a98fa0ba22385

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.6-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2c7364a50c4fdb8ce9acc4e0c21627e52f4eebee98ff2d8a19b6d4302d0be23b
MD5 82937abbc3e9ef7e5d7ecfd7aaa19846
BLAKE2b-256 cf5243e0b6ffe0502deae7572b0e6381fbfd40d2ffcfd3aceaaa505d44958309

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