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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

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

File metadata

  • Download URL: clang-format-17.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 70c52185946d7ffca8901412778ac03b2a935a8009f01599fe1ae530c68a49e2
MD5 a55d223194f41418d78796bd5780bc91
BLAKE2b-256 1b1d273f9d2d5c891f04324cec561e6443fba9b4e4706d4016443145ae5cc612

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ad9fb9b87fdeeaf45f0e25ad8ffef3bca814bce336a88b62fa0782a6b1bd8f89
MD5 692649a48eb8ceab85950df2318e49c0
BLAKE2b-256 957f0ba8d7327551df5cca6a8b85de294d5f78a8387dfffd71c6f2c392a260d1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 c3d513fc3f42f2b58efe9027291bb23c52d125335de540b47ea94183d2faad42
MD5 48aca3905874a995f520472141e6642a
BLAKE2b-256 a506f6ee1ea26ec48bae76d2e31947f7963b68b9e250362248563e23c00d8f00

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 fafdc5b673cb791b6034ff9db8cc45492a27da1a1c7e7fcb9a55dc2748828f44
MD5 27ddae6e2d06a06ded41becf3f371af7
BLAKE2b-256 871da4eeb3c19f8fe3c2d5b0ec10db77d84c574f332f35ef99548e89c5e7b8e1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 3d7a63f32f48b8ca670a797cd574f1487472ef83c0f5eda94fc6551e3e187fe0
MD5 d8c703565baf7e7e637d6a237451b6b0
BLAKE2b-256 674904c8e4a4c4ab37fff8bde381f9733ef32ac462518b6b01b00b8ffaaca4dc

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 9ee9cb981bf41a40eb3bb74601fe830edca94fa0baceaf9c104643af401c3a08
MD5 8b68739a0e465db11f6e3940fa9c7601
BLAKE2b-256 1e068607b149bfd3c6006ac62ba55104e59d5a2b2b6d9113c8acea47fc027259

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 0f872082b2bdf8bac03e15ebccb9086b0d5c456d1381a158a8a0e52cab80f4b9
MD5 96c16fe379e0250d0dcf4b9c98fa15b6
BLAKE2b-256 a88eddd09281620af2dff1fcd84ccd54c23365407f9465719d4c7042afd92152

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 bbf8837f201c30284e70f9b32ef069b01cbbe9c8019fc4fa699ee6c47807d11c
MD5 6b2a6bb079b1aa74475d356d033df614
BLAKE2b-256 ac74d1ac15c6f3b31a6b742da7b004536f382343eb71b6eb56d8baac50ffbc40

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2bac05ac9c76fd28e936190c2f5644f427be813f2c44eed570f144969cfdda4d
MD5 e2ca09daf67883e04057eef2fd4e7c6a
BLAKE2b-256 0e286a53cc9fbae48052cc07cc09d51ba3ddda2c1029642126d087c52d2adcde

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 6da6d64c538b2119caf98b7bb5fe2c3dae0ba38d51cb667d292b5a77d0607324
MD5 f29d2c4a228ec3573f347933311261f2
BLAKE2b-256 9f86750fb169e43b56802408bab97739e2721b9a9a31268b89f09d3e26b49c0b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 d55ab88a1135e7d2331fb350c7759f63d09acdcc8985e0a89feccda34dd62149
MD5 08007494ecd0fbe76c492aba2f82835d
BLAKE2b-256 fe467f94393b9c45cbf3635f1365a7f3992bac119c9332c2c7ba8e5d68b5ff81

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6bfc87a8a785f096fb827ff0d635375624faa3ad1034b5b2f6f7b45523e0903c
MD5 a5df46f92d0ba228e0de8b9e003edb19
BLAKE2b-256 9275f658a85c97ee597a04226c6a0ebeabe73cc3c7bb61aca66028eb945ed6ae

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ecb087f8259c0d01f8b985e0b0e2574fcf5757de2d224452983f64f571e8041b
MD5 e4f54c5d7a7e31e9bad7f1103c5f3461
BLAKE2b-256 eb5648d24450393cd2eeba52c2a89af4a4756740d2f63c0fcd70097bb23527d8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.2-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 094b896f26e31cdd6be24b1663fac603273aaf1afb5661bf433155fbefcf8e05
MD5 00d6364f45fc04442e517b37002cb7d4
BLAKE2b-256 f983808b9251c5006757b5c3d1eed524d494b4d2ab4e9cb2f4184cdd4109e572

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