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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

clang_format-18.1.6-py2.py3-none-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ x86-64

clang_format-18.1.6-py2.py3-none-musllinux_1_2_s390x.whl (3.2 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ s390x

clang_format-18.1.6-py2.py3-none-musllinux_1_2_ppc64le.whl (3.2 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ ppc64le

clang_format-18.1.6-py2.py3-none-musllinux_1_2_i686.whl (3.0 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ i686

clang_format-18.1.6-py2.py3-none-musllinux_1_2_aarch64.whl (2.8 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ ARM64

clang_format-18.1.6-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.6-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.6-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.6-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.6-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.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-18.1.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-18.1.6.tar.gz.

File metadata

  • Download URL: clang_format-18.1.6.tar.gz
  • Upload date:
  • Size: 11.0 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.6.tar.gz
Algorithm Hash digest
SHA256 46be3f362b82e7c40a96583be9bb759b5c55df7f7458c7a66e31da9a11abd746
MD5 b72737435c6f472ae2a880c60147143b
BLAKE2b-256 0e76347561a82a6b60ddf2024d87f4bccf21050c6222b30fc6cb5e94a0861754

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b2caa53fe0a5253c0aa5059bc25789b23e2069b3d6b44c7a72793544b92c36d1
MD5 6c747fe03e1d6f5bebf6a1b69fc4dd74
BLAKE2b-256 4baa50cd25688a6fa4be4df7246b8fcc0135cae19b06b41f216d72c7530fc6eb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 b145ab877c7eb6846a9f302ada127ace3125ea8fcdeddd901a1c8db3818d4ed0
MD5 55f27711589f96020aad2d3b0ec3947b
BLAKE2b-256 e883812ac3c0d9f873b0bfc11b642dce6d8ac8ebbf738688d0c42f51c83aa561

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-18.1.6-py2.py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8736cde40528c82f219ea1c5981ece5b30c0ac8e24657aa8528ddf9fd712d0fd
MD5 9cb56881a663c32772280dcfd6dbba98
BLAKE2b-256 21b81068045df470e0985becb40d9805b9eb8a4c510223f9f57b5e2bdddbb6c1

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-18.1.6-py2.py3-none-musllinux_1_2_s390x.whl.

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-musllinux_1_2_s390x.whl
Algorithm Hash digest
SHA256 5afd4f43a2c0861058ce829d2121de776ec0422f6a8748ff53abf159e698c01f
MD5 7943182e58259d361cfcce2760a7e253
BLAKE2b-256 90ae3668f5071d5928c4bbbf724eb33738c78d3da43f480653ed766ead6e650c

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-18.1.6-py2.py3-none-musllinux_1_2_ppc64le.whl.

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-musllinux_1_2_ppc64le.whl
Algorithm Hash digest
SHA256 65f18fa9379d285e6fed833be06ea75956129252977372942b04f4a1aecd1a7f
MD5 6db03cb6a61a2984cfe5471a26971989
BLAKE2b-256 304745c65b8e5b21736f4cf099c1dcbd920315b0cb09c3a945cb25c38d9e3ff2

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-18.1.6-py2.py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 fb20d86a0d3f27d71a7b43ff17e7cfe278c90e77871e03a218c38501b2b56d5b
MD5 61b27742bf90a089cc67926ec7577604
BLAKE2b-256 7be85af0f667e5d3fa898c380096f1af99fbd2bb21f86f933b79989c774c2a92

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-18.1.6-py2.py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c61a61e6e05db0aacad057364f863e641deae5e2c588ec7b84b7bd5a19ee00a8
MD5 a6bc68ed92bc99dd522c85f38432a69a
BLAKE2b-256 560fbcad6d89c9ea5ffa7e7eab8d9321a001725829cd101f37f3f30ef4fd11c9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d706264176675bf2bad25cc53ec7cfe592747af01612baad823677c1aea35296
MD5 c169ed41cfd3bbe94f8085a9341e552c
BLAKE2b-256 814c5a026f8a681f1f8c5d8f1a660b5b71526ad379564eb8d119e7b50919f5a0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 330a10de6f08008e2a429f1bec6179152fcbdd69140ca189d8722a1f8c8a86bc
MD5 f99d20091f5531f45ed79c4e0d8bf2f2
BLAKE2b-256 d1c9e9eb9749f04eaf8f2a7637540a0a68fc40bed25750d3f0c5bcf21781a29c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 3e3e5d420e5bc44fb2db939e94222c4d4ffdf7fa690326157971015b929c286d
MD5 12d190c4fc39f9703a236c502b2cd9a4
BLAKE2b-256 aecce5dc1fe982fc6c0fc1daac88840fed8efa9b5d8d47c16c3cf33bc9c7e07e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e1b9383ffaf4052cce2d4f81d9714a3b3f60811cb0a1e190df2bd38e99f8d588
MD5 62c762c53177d2814af5a18a321f4f48
BLAKE2b-256 9dc141ab78cef5453f10467298e9fe0d366db82957eccb574065ab3fa2adefa5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 976939a7cae91377f479aadaf8feb421ec9f143da909315ed18dfa4fa085a19a
MD5 652fae453c014b0e51c9e202869c3fce
BLAKE2b-256 2bafc4c3b1f2938cdfe9b1852e7c905dce268ccd7368ece4550f48193394b980

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f4bdb17e15472b76da3c358d70c61ab07951a6f8e97877f30ad665cecf961e0f
MD5 ef2da35f628717c7b3d43197e021f5e1
BLAKE2b-256 0dbfea34f02d39f0bdbc53155b7e97a46826bba3f82becdf77d6ed9b2b2f0fe8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.6-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3f0baa4971d68fd0b8499abb342b6db45de000e1bd54d4f5430a2147527e34d1
MD5 9ce75be8c3584e2c878c37e1b3f5b445
BLAKE2b-256 56cb942c9f41bcaf9b03849546229cabe40c55e3eb4b2ebfe319fdb565489586

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