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: v16.0.5
  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-16.0.5.tar.gz (9.7 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

clang_format-16.0.5-py2.py3-none-win32.whl (1.1 MB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-16.0.5-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-16.0.5-py2.py3-none-musllinux_1_1_s390x.whl (2.1 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ s390x

clang_format-16.0.5-py2.py3-none-musllinux_1_1_ppc64le.whl (2.4 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ ppc64le

clang_format-16.0.5-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-16.0.5-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-16.0.5-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-16.0.5-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-16.0.5-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.4 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

clang_format-16.0.5-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (1.7 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ i686

clang_format-16.0.5-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-16.0.5-py2.py3-none-macosx_10_9_universal2.whl (2.5 MB view details)

Uploaded Python 2 Python 3 macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file clang-format-16.0.5.tar.gz.

File metadata

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

File hashes

Hashes for clang-format-16.0.5.tar.gz
Algorithm Hash digest
SHA256 59a1df466bec1fbfb6fc022ad3c03a3f98965f530d440bf0318a110617078e4b
MD5 76b35ac6ae2fd77193974f98180ac3bb
BLAKE2b-256 6eeb2d925e51d3826932a3a219dc7abed1cc6681a17d262ab00df5e8edb962f3

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 70ec2b7be91f2de10704d812f0a975b0abdfcda75f369facb2c0a0bbb6a888ca
MD5 2f27684f585d2f5353ba96790858a504
BLAKE2b-256 048d6df2f067decbacb601177a78c0cab50093d59e19126d08340e7ae12e8e98

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 435c31f5ea31414bcc7b976beff659f2e8106c36fe1a9661530f33d5791eeae3
MD5 8387d94bc785771e2062189403813a1c
BLAKE2b-256 c7394ecfd9b09582ddb298a863a670dc6f3cb2e8dae0cf97018c6eea4dfb0735

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 2428a506dff768e1cf1e6583d5eca0ea58927c0ed8d5cdc5cdc62ec8d8108ee3
MD5 63a42b4f0c49b550f317cf96a6ad41b2
BLAKE2b-256 a8a1cc69228411d3af18c8e597e4a6f118a3649cdc74eddcca643dbc12887981

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 8030987a74658d9312bb5a3769c309651a5335b70f8a7e12c091eefaee975abb
MD5 b6d9827b1a1033e0bbb0a5efe684c7ed
BLAKE2b-256 a6d3a251d7ce0a1a2deae66f2a4347dfc3b1bacba07a135d63fbe9e748ff4a0b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 6b8e575c68379d70aa3c2b6b55f7fd83a986ef3b63ca63fa4ce61968741c0508
MD5 c2ecc76026e31c9d335ebe88d7c88e4b
BLAKE2b-256 8b935c87733796738e467add41fe285ef13658031c5649ada7a67c8acf5a6573

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 03819037273fb9e7339dad25ec469b95eeac4ad81477df5ec8e2a52d2f9bb6e7
MD5 5c3e7c4de7537765f49915451e6169f4
BLAKE2b-256 90f04e672eb51d972bda37ac975006162a8f07d4a8e28b24542770f83d7b7ab5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 2225ae315a17ece7e975f6dee71bc2103917b467f840540cca507c91bcd0b48c
MD5 5bf137509cb5564b54db1cd21b2685e6
BLAKE2b-256 4495104a80c52f7cc1f48637f352e7ae2ff8f89b0e0e4ab2909a479cad9c4375

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3b9247d6131564d716319b2809489a85cada49855c8df8e5683b59c07976003c
MD5 09fd5e3d153b425f83b9c158428c020b
BLAKE2b-256 14f0be439cfb9df1def9aa607374fde01c2d675bfa3f706985e9f869140b8228

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 973fd3caee5713c61ef4a26aee8cb9d5ebef97567da180157c3a6d7406639e99
MD5 f2bd8057c64542411047a3771f88d4b1
BLAKE2b-256 ee086587af7292d0801a0b9f644e2f2e20567901737b4fcd5eebaa24b26c6b98

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 305176fe6c0b52d874e9c466824db63f35442f2bce1848a28b1357e38971ac43
MD5 9c7fc330fbd6a9193b0f2849373d798f
BLAKE2b-256 891ef76824481cd74e9e3433bfaebfda64c8aeef26bdd1d8cbcbcabdf9463a58

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 90e363dc0d194ecc1105c523cb87c741844145dbd37eb4dd5cba09a7e6a6cfb3
MD5 f0874fcee644b5916b83a77c30e66b34
BLAKE2b-256 a8e01109a8a875a22bd7975a55431e87b9590f7eb729bcbd03bcecd051fa857b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0845f22028f0e3c373e2d72d1bc77cd395ce4049da52ac5d68271fd0886aa1c8
MD5 01af5a33494050228d66aa96f9eb1de4
BLAKE2b-256 f6a035fda245d5542e37bc7e15fa32bfa0ea07e6460b16141b051e44775e0c74

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.5-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 daa0994bd94b8ad62139e7e41aff476433976294a7c134e72c31982b3f2368a9
MD5 28796ba9cebfb0ff63e02eed473b590d
BLAKE2b-256 0697cc124c5170fd7480dc53a9141687af6627b0b6f0f875e8fcf18c04b18cb4

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