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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

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

File metadata

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

File hashes

Hashes for clang-format-17.0.3.tar.gz
Algorithm Hash digest
SHA256 763a3f276e579d5e304527229420b1e0c9aa12318675a21c0107f9373e918ab1
MD5 35a62d6ae103dc73c9d4bb1313379bc6
BLAKE2b-256 b9ce10bd33fbd42d0b8728883faf80cbd0c739aacae11bd9c1afcd63ac258886

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 da9845315b8a3612b2e9a1d3fd91b3609ae3853cf13effe71b102e3149309e9c
MD5 f705ad2ab058fd08c51fdc6c0b32b0a0
BLAKE2b-256 830ddc08ff31b247c762db64374c91824dabf20a7e9eb11d082a84568d5daf97

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 b9d8f743f6c50b2b3e15b33a84d73f67cf40ac81f09aabd31a9cf28aae6014aa
MD5 5a77e16da79cbfd359d8ac10bd1b3081
BLAKE2b-256 cc1027a0275fe029e03fe785d01eba4f5ba914bef9cad1a52e4ead384c2a6adb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 b1df16d0f216cfd8f43866ebb44c09a437cff9cdae25a4c105bea45266a76c31
MD5 07826fc8df199ee58fe0b35bb457303b
BLAKE2b-256 7defed6fc76b204cadd1da65a8eb0f7bf2a43fe2de2a6b11a73c7ed7273dff05

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 acd183964f7bf95216aa9b91b8856ad3bef91458136ef049c2ebe70fccb01dc2
MD5 51cca056ebfd0f748a48ed849c95b8b3
BLAKE2b-256 aaf2fb71be897117ff6489228f407cff85464672766dfa29e783309943f23016

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 a4cebfe34b2771cb81845b0575eff66d105903c3d67a3bfefc5bba0e9dad2a0e
MD5 c2d3c9aa8d5fcf0a247e83758d99805e
BLAKE2b-256 61a54c77a93259fc20c61598599e8e52f6365fc00d346e44d5617b8336990e65

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 69c4eb4f56c19ab36902e2b8e93056f592cfdca585f5f1c2251d5da6307e7500
MD5 435697cb6c98a0d481f4eb533bd062d8
BLAKE2b-256 3026ff5aa8a6a1950a85dabeee5b4c66ebbd464b33931e7e3c1ddad1dc63a06b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 6564bfa5920dd58817979366c45de9a35c0451dd3a6f0fb9626c249c66bbbf26
MD5 5b32d27cb54025ecffbc454caa455586
BLAKE2b-256 ed047e9cabad142e2ecab5ea1065501f87fbdf281e6b7f17fc3d0e3729c8474c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee5438e9194b3d077c0a816c720f105a18275c2deee35010468b749b884945b0
MD5 89dcfd1eb498af46d56a281753db745a
BLAKE2b-256 cfe0885a0ebb44d0aa280c662fe10b5b1563f2545118d6a9c19b0231dc0ab8f7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 4499261f4ec102a627612c8959cbf67fbb40f7cb74d0f7fea375414fba1d753e
MD5 9c149e56bb11af3f6be89b71c707df43
BLAKE2b-256 e45525b48c96a52350aebc57d67286422646673ffd2160dfb92a1354ae376f11

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 75240b633b4be9eedae8546170e9894a1f15c6ba6fe0ecdb056c23f7f7364bde
MD5 e5be498cd1ed954c52e5b0bb4f39bb9c
BLAKE2b-256 6e9efa93c07e000567cfef0b75ea3d9de23a5e9772b1800a47df089208848b97

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 1210b71b97eb668ab8034c5bb66b09009cf2b66091430ced60ac8a98cb8b4c50
MD5 db039f6b4865b26cfc667b6f486c238b
BLAKE2b-256 ab91ad4cb9d9c5c6117e620b1ae710c06ef35f29a654a05b3aa505cf63e13f09

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e802f1fc110d547eb0c56f2f8a2b7e9e850843c3f9affa44955b1a55270ff697
MD5 1193277a8c0bd69e9cee02e9171be881
BLAKE2b-256 73891cd72ecfb9bc852ace9264bafcfeab00f3fde91b1f546019276550c5a2ef

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.3-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a709bf556198b503666038c8b859347db26d3c63d76addb7d4d3d23bb99ffd8f
MD5 88f2bfcfa1883f13176aa08ed3e73ec1
BLAKE2b-256 ce8050aef94f8dbf9e1ed394d3fcfaa64620ae13bf906c04c52fc28e0a0542bc

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