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.7
  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:

Alternatively, the workflow can be triggered manually:

On manual triggers, the following input variables are available:

  • llvm_version: Override the LLVM version (default: "")
  • wheel_version: Override the wheel packaging version (default "0")
  • skip_emulation: Set which emulation builds to skip, e.g. "qemu" (default: "")
  • 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.7.tar.gz (11.1 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

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

File metadata

  • Download URL: clang_format-18.1.7.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for clang_format-18.1.7.tar.gz
Algorithm Hash digest
SHA256 57090c40a8f0a898e0db8be150a19be2551302d5f5620d2a01de07e7c9220a53
MD5 2071602a1f78acfd7be11e3e221f8648
BLAKE2b-256 6b38f1be8318081b939e536a5a4fe25bedefd1c61236531e00bab2161cabd31c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d6a2f051124d6ae506ba2a68accfe4ea4c8cb90d13b422c3131bb124413bac32
MD5 f83d02c5216dc1cc3bcb6ee2e25cb7fd
BLAKE2b-256 4fae1d0894b547c3b7f9cd2962fdca9feb5bb76220949acf5a8ed97ca63daa9b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 f935d34152a2e11e55120eb9182862f432bc9789ab819f680c9f6db4edebf9e3
MD5 eb9ed0d00da81b90454a66f81bc82483
BLAKE2b-256 7efd5adeda828c4b8d2c646766653edd294cc3a639c1fdf3e6aa32f97e8e9df4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c151d42e6ac7c3cc03d7fec61bed3211ce8f75528e1efd8fc64bdb33840987b2
MD5 8059b1904dd8e105fa77f91e2b710658
BLAKE2b-256 9c1b94d73bd66cdac737e4d8af5a2cf9d1995e4ba3a8e6e47fad0d0116613658

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-musllinux_1_2_s390x.whl
Algorithm Hash digest
SHA256 a62fca204293893badde0ab004df8b6df1d13eac4d452051554d9684d0a8254e
MD5 552ec78177630fa5617239bc641743f2
BLAKE2b-256 4fcbb3dbfb5cb4546af99b80b115e2a66c847f854380a3a68ceebf249db11551

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-musllinux_1_2_ppc64le.whl
Algorithm Hash digest
SHA256 035204410f65d03f98cb81c9c39d6d193f9987917cc88de9d0dbd01f2aa9c302
MD5 117d74c50ad37f3cc9f39f176909484e
BLAKE2b-256 dd791d0d35fbf57da3eb0733a8fc640de009cd31279fc9fc1222d77de64cf299

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 a914592a51f77c3563563c7a8970f19bc1ed59174ab992f095a78f4e142382ac
MD5 70d63848cf250417c60c19ff8d93a926
BLAKE2b-256 5b503e5992730876f5905e155daf31edf61e27e94c4d23e1b8f48641c77c9fe6

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 f4f77ac0f4f9a659213fedda0f2d216886c410132e6e7dd4b13f92b34e925554
MD5 bfced33a26d36fbbde733e1a9c8809e6
BLAKE2b-256 a872b484390cbc196453fd7c7440827fdd03bab22fefc9a175659d2ae4f4216f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 217526c8189c18fd175e19bb3e4da2d1bdf14a2bf79d97108c9b6a98d9938351
MD5 77c79644d697af5144faab5500473e7a
BLAKE2b-256 f7dc099a5e4b2b9b8cccfafa6a73d089178371ad53b6735a05fd6a9d8d9aa005

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 a49c44d7cc00431be8285aa120a7a21fa0475786c03c53b04a26882c4e626a43
MD5 adc106d6d209cf8ed45e3ed4955ffad9
BLAKE2b-256 19dd711f1ad5060d62a010fff6c7cdc9fb35bbadd9e2106c5887824f2a46ef13

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 05c482a854287a5d21f7567186c0bd4b8dbd4a871751e655a45849185f30b931
MD5 600a9bc40820faba4fd8e57f8edfc72d
BLAKE2b-256 86bee40586daa270d63584b864f67451302d025783c98fc14dd9c2dc9db0676c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 607772cf474c1ebe0de44f44c1324e57a2d5b45a1d96d4aff166645532d99b43
MD5 b7a69e2e870b147006964ce6db6bc372
BLAKE2b-256 f7ddc62027b5e74df57f64169789285fa534b21bf6a55c08d64b8826bcd1c8d2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 42d0b580ab7a45348155944adebe0bef53d1de9357b925830a59bbc351a25560
MD5 236076df4f20c3e2e95f42f669d03562
BLAKE2b-256 eeb9069b6ec7fb36b4f44e60c21e7e9fec504c31e8582ef56b7ff549c54457bb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b3a0a09428cdd656ed87074543222a80660bc506407ed21b8e4bcb3d6d3a5a3c
MD5 9f2f6f2b3a53c46c8a35cca093474b7c
BLAKE2b-256 94d0a38db8e127f718bdf104ea877020de581873ef841f39586efe8002773978

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-18.1.7-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0b352ec51b291fe04c25a0f0ed15ba1a55b9c9c8eaa7fdf14de3d3585aef4f72
MD5 3d82edf049b87a4dc05fe8739d291c78
BLAKE2b-256 ebb936c0fc5d77b59b85cb4b0785c1df203cf0720e619741c05af461f82ccfb8

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