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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

clang_format-18.1.1-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.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-18.1.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-18.1.1-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.1-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.1-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.1-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.1-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.1-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.1-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.1-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.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for clang-format-18.1.1.tar.gz
Algorithm Hash digest
SHA256 cf4a837737a21c098347f5c8d5579472dd72f5aa6287c3ee45f45366e6eb100b
MD5 81536db51b7e27f7a0296adf7da08923
BLAKE2b-256 b97268f7b93363e9a413455d6e0f699ed33d635b11d3282a6b31f66f5c176fc9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 7f38142aacd670009ea958aa0c19cf7905392890c6d3c6cf8047135d37c4306e
MD5 e04e69674cc440fd45587ded86004ae0
BLAKE2b-256 9785b785272c788344d65caa85ca3e25c8175b474df6301a4cdddc8541163dea

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 a86e03e686526961b8fc426670e391d696a94ddb890f5b65d2e4a5581136ef8a
MD5 f897e5587da3773216706cd48589d25a
BLAKE2b-256 dfac9df1f3caf8cb984a4448cd50d80e06d8fc0cd0cd85c7e0f48e09cd2e86a8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 426cbb0f394916859ac258b1a013a4fcfd906de968246f0a0073f6e17bb2c30e
MD5 0530ea85b91c39a966290d25e4c6a275
BLAKE2b-256 86fd4f15a01f7efc51914e3bddfb44c2c1999457763550d9e2f2336cdadc9dcd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 a500b98e9311e915dfa60206d2916276f30063014eb2744d5089bc841a5b95be
MD5 93cbe8aecd24eaf0daa105079be337d8
BLAKE2b-256 09117d4ad7b9b020ed08da2a562f8398a2db5ccb57cf41abd973726525b30335

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 b16759fe2089558228001341fbf00b623e00c34ad3535a1f1ee48402a0beb6e2
MD5 a7096bf063ee5576c4e3cfc8422d56b9
BLAKE2b-256 d66a6873ef5fb60c25add678ab9453c1fe3385d1043231ce4f3eba987217fd7a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 75e7ad8f83aa43bb00cc97d4ea9b0eeda68e50c0a6ca394958786ba6e1b720b0
MD5 2bbbfc66fb571d7b4b9345ff88071818
BLAKE2b-256 0373bd34cd691a2fd52d41383cf2fec0e6b662126ecbf8e0fadd1c0dd54d53be

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 414d5e4328e88ff72800530ab989f25a148f639a873a32037004001b8d0e800e
MD5 987ff1172e5d190950dc8e94a833ec83
BLAKE2b-256 343e4e808fc23e673f673d84aef81b1ccb86a6b88583f78e13b7d8dd17dc1993

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 650a315767ef4d3180af167dabc18b12d374c6c23df01c0732f8b3c878a83f00
MD5 11686eca8737e04ffadcff5d4e4c288e
BLAKE2b-256 93ad759986a5f096d480b0bae4dbb7e11726c14d16d97fde94fe0ea676251a6a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 963a0e695e0d5e3e269b7c60107118d0c92fb3ed407c08ef001f844eb8603724
MD5 2899886ac03830f3b3061a2ae4bdf3f3
BLAKE2b-256 767e0cb88b9a4358648d17d8307b93a5dbe0b75c81802dae86393215872bbe48

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 d490af8055a9b1ef69d42733f1c07401e6186fa23b23e0dac3d72574fcb49aa9
MD5 e5e08ec5ee45835e3de2619ee17dded2
BLAKE2b-256 2f89ab8567c8eefc7d0362ee3dde77d84e180a5d30d96730fbb61f357cd02b90

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 f2376423c6338224bb7a004321c0c458eb687ef2985499c5168108c7f70cd3b7
MD5 a5a4e0800af194c3d6211d41b7d7a501
BLAKE2b-256 dba1beeaf36fc8064ced094a992b831881f04a20e8e57662143e7514ca807c2d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4b2c8ce9fe6aab049d5f4b5fd9deffb2d3db37598eb71f963b5d8758230577d5
MD5 d1b9a28c51f6c259ec51cf271fd87009
BLAKE2b-256 06636a1bcd88b76c834e640b36fe9b89a14acef86f1490f7a16707a0c98e959b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 66f4c313e7667034e15fcfb06b1ed8e53927a133c1ed131e1774ecb82605779b
MD5 fd00cc95306d8949863cc3942036c014
BLAKE2b-256 3453381d1de14b9972873fc3b5fff6f2b658f8cb670feeef360fb002d52970f1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.1-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 462c0a300eb23856fe25e4ca749ba6a8390d91ad05dc2020066851746bc3ecc5
MD5 209aa15d5c6a6248c53eeca47ec7a462
BLAKE2b-256 4a2737d150b61037de154a121fb3e6b08f0319455b462894e831592a67d463f4

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