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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

clang_format-17.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-17.0.1-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.1-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.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-17.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-17.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-17.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-17.0.1-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.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-17.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-17.0.1-py2.py3-none-macosx_10_9_universal2.whl (2.6 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for clang-format-17.0.1.tar.gz
Algorithm Hash digest
SHA256 ed017015563d5195de2edc0e99ad7e10040cb724057b4968705778e8dfff068f
MD5 84a5fac4c8ceed611ff82dcd17246235
BLAKE2b-256 59418853fc75def5c70440f2713213f20182cbc759fdec630515e9164cc38d1f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f2cde239dd6d41a374aaee7749444b982da29d64a3db68456fab883489b84744
MD5 9123529a98a3b0fb7d47be12c47fdcff
BLAKE2b-256 76f4429bc45db77a7b176e13d12d7237605a2a91443cf2ae7d448e48a5b19160

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 6cb1d56665af56b87f3dd7f445a3dbc74836c4c814ae42ffdecc9573dfd5ac26
MD5 f9fa651157dca5436da0223d323a23a8
BLAKE2b-256 dcd34ea450da1bd28aa419b4843229650718b1c54c4777b4af260a75ce97f5fe

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ffa0e7153d6af1f18fa1f1838a472bc6feea5f8deb8516e50cfedd60527ea274
MD5 edd2a0937fcacaa045518ccc07fac1a7
BLAKE2b-256 754c1d5c7f70f16234ff71402e135b9d4a10bfabd190a459b47ea73fb9321cf5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 8b3563ba153ef3613f10fafe42276ffd8ee4177001e6bba6d03a5573b051d568
MD5 c74b3f9487a90a096224803f1689aaa1
BLAKE2b-256 e3207bc31a467718cc33c78c219d36ec7014a24984b807301fee4a6875dbef07

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 c2f15f95d324b6f963dd00355673216349d88669826bf11e664cbfcadf84ab0e
MD5 e9b4445131a3eff615bcf4284fb60fdd
BLAKE2b-256 213bc8e85ec0d49a593414f1cace2789b07fca23853d59187e3979053766e208

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 726187da6f3120af78a2585c6a13063b82d53f36072132a48f11af0ab1aec3fb
MD5 c16fa2668e10c510552375d30c3002fd
BLAKE2b-256 e36b3f01112f5cd638537d3cd5116d0105baf41a51056ff63050b78db0cf11e1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 63b5b454cdde493666227969a045d5641d642c3835489dbb26ddafe6345e20fa
MD5 46bddf09067e3cb4e7192f90515b409e
BLAKE2b-256 6deb559b3a934109dc6163b6b93c5acc6f854c90c40f6a94a88e3d5285d28621

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5a7184aac33cd086c116186eb6aeb62fcffb0b8a9e4dc532f9c6cdafaeba400d
MD5 475b1f08ff89320e1a8b873bd737b808
BLAKE2b-256 893b5ebd3ec6cdc8a66d489af4b6ff5389e5891b70a7c0e1553674ce358d3e89

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 2f692ce62454aede6bae4c059c5bc3f2996e077440ac2a363bfb35222b509255
MD5 3665d6f79c84b5a14032ed41a54f2a77
BLAKE2b-256 7834d4c198fd1af1386f3f9fc9fd9d9e78dcc4a38156b919fe526a1f00048295

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 b82998fa92bd26922939977620174becd2c0471e0271acf7a9247bf7adfb5b45
MD5 cd145709008613006e72b3ef2a2019db
BLAKE2b-256 95043e5508ce16d8bbe235f0e3a6b6c4fce029d8ec72fa4ded597e470780e106

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 1786db4b7201055932b5eab83716f0065dbb9ed28528b0fb9b1db4ccf2f1d837
MD5 c3008c2f0da249175ba0545ce090ab44
BLAKE2b-256 c09d5761467f8ded43f4cacf857726a40816a491fe194c9216623f6c128771ad

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a2579d779ff04f43e44b7c507b614d7f053e72b4713b9c45039d509d6de640f3
MD5 2556d1a5587f3b314b517d562477aec6
BLAKE2b-256 02f13ca53bb6c4f86902fd9faa86730d92ad5b6007d26c260835c43a08e8365b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.1-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 88b84ef2255a95b4e4aeaf3c207f4f7521e821b6988e91948318ce5ce4665670
MD5 501ccb59e478f2a0f7e462f8336d8b88
BLAKE2b-256 337292175d2b9a454bc3b7b6fa5699aaf58dedf7e0b9ca0f2cd576ba04df90b4

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