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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

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

File metadata

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

File hashes

Hashes for clang-format-16.0.3.tar.gz
Algorithm Hash digest
SHA256 62b9bf91c8ebc6dff32e261e2e1e8483eff58c1cf43607706e235e5cc89c7f3c
MD5 6013be60bc9da9c853eeeec960c49c9b
BLAKE2b-256 4d07df31f6c79403f1d64869e6cac05079a2b120f84b0892a90294f90c8d151d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e9594a76b97fdb449b2c9592e88eb3d8008eee452f330082237b4c666589bfec
MD5 cdd4dba8bea48f0fc286873f85be5add
BLAKE2b-256 f3d690c1d6c006cd4206600c9dc96083973b9ca0af8a521014bc8e2d8804d8eb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 a4ab97442293d62e3febe718c3fc716ca9cd4a7e5f1ae6c96e5c8077b9bfb6ec
MD5 157b992f01e313895e72c115898358aa
BLAKE2b-256 ca39bbe9065db279e1c81387fdacb31f2c9597b0fb70bf63e319509189c221c7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 425058f6d845cfaebf5917d4c9cd7e926f8d9a834c415c89d624c4f0354e30b7
MD5 96172a242b57a538794f4802a3c80050
BLAKE2b-256 30357a3cbd08e4aa1ecd118d4d8e118b259b10d3c87e281228a18b930bbbc3d9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 49c46fdb8f386a44aa2cd2513687136ebdbbd5526f0da2a39ae77cdcf3785d26
MD5 09f623b2f539246ea6fc9fc033c2f63e
BLAKE2b-256 e4f0dbaad73dcf845513a983c48efc7290373d6da679ad7321733e7b2b268e6e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 a0a49622866c259278cc68faa044f59828892b45f90cb27ce560ccf4a69e8aee
MD5 359f692632fb320fedc980c8330b8ffb
BLAKE2b-256 06094c5b8f9b60ced9f6b4d53b5aef69cd89359383718b3b32beb8ed9b089db5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 f32de5c79874b758fc9cdbb39387c4ceb3c6d3aa7dd9e9bb1f1cc8e8c0039098
MD5 cdffbababd4c8ca242f485ec6131f7a1
BLAKE2b-256 8e1fab877f781f99bfb457c1e521dafdf6ac0447177885cd95eae4c4eb78f39d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 515f387fb46b2bc54e9f054d953fd90e2efb2db1103dacf05af19eddab84b832
MD5 6f4bbe25f69c632146ea9c998ad89afa
BLAKE2b-256 fa4cbbe595d0bafd32ec73ec56876cc1f730c4bfce0a4e1a3d2f0802514681e2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a6c33233e7c0d3057820e5d02411565953909cf59dc913d9c24b5c08fa561e05
MD5 8ee3749b94ca67691d781192958e45a9
BLAKE2b-256 59c91f0535c6019990b28efb02a51efe09c29219d230f26209577dc62c9cd91a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 f478d47eb6bd6cdc026d8c00979421af51f57d376a8c8355b0e2b673572151f7
MD5 182ebbab4b13fab4f5d2c76c1a656b88
BLAKE2b-256 9e36c6509b8eb19bdbfbcc8ef7b29d58635b553733ff7d3debdb38d1d1a8597a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 30317bc91fd51260fd591c3fded0156021c540169e28921dda911bc146f499ee
MD5 89d15b194b13d132c8072ed58a4cf9ec
BLAKE2b-256 1bd25fc1e258b7827ad1e309c8ebd7c7f20fad95c744398d51afd492c8e2d75e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 844ed39192d5c5a53aad9a5eb57424fba5a868cfc555e724be5a5083bf747d37
MD5 dd6fa9980508bcba6c0868408cee53c6
BLAKE2b-256 39ad205c00d177ff058671575bd5ad6742237b6b5c9ddaa9161ba831dde68057

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 57b6e5daefc69d045b28c439b6f301c74f4ef9e93cc0f6a0434a1807e78a0587
MD5 db061f929de534c26b4987bbbe588d7f
BLAKE2b-256 7fedb7b430748993fcee12d3c7eddc92dcdd06b24b6e19fc28c1c194c2d7f545

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.3-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0f2937e780f955191fac6786ef36ac8e3a03b455c363fc9af069c90237bbf1ab
MD5 d21f302c9a4db65a364e2cdb5f8ab3e5
BLAKE2b-256 e9921cc2e8cdff7f4329d5e51f09cc482c9b7b0d75ef024bfb66769a928fd9cf

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