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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

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

File metadata

  • Download URL: clang-format-16.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 772cffe40b97872ed74e1cf83c7401340a87bd2c1228da6bdd81ffb30c753e8a
MD5 efcaed9b2806fb412c931f8e551f8d57
BLAKE2b-256 0728b070560d7af346316245eec150ccfe8899731e0fe54c7a16bc8413496199

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 df69db2d4504c83b260fe5b8f1ab6468505d29fc411d8501ed45349eb54025cd
MD5 f6202c366dbba972a573757751f0f8cc
BLAKE2b-256 6977daf881e1867651b655f3c2ff660dbbdc7ff26eb913d3084b297c4d0e0fed

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 1fe94d31b0ad40bc8a0145f24a44ad19c5a137b14f5392fe0063434a23c00999
MD5 c2a1a28ace239677b6c9fc196884e8af
BLAKE2b-256 74eaac3708b121d5ac4e44c63ce2bc62bf00e1b78139ae11713702f4f05ecb9a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 6df4a6f8918a065bff8161e8cae9ee0dab58a8f5626b1fed406806b7e8c817b6
MD5 16999fc195ee76cdd2730e0c1b29a826
BLAKE2b-256 d37a69f1846a27e6d360f7fea3b31193ddb0c6861477d79074177068f6396c5c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 4f6ca9fdf0eaba27225bb33dc4a75112304e96e4add0f8314b091ecbcb2b9826
MD5 3628a3a70078237e6fc547228c628e39
BLAKE2b-256 7accec20221c736a5fa873c7d42c6eacfbfd0dfb764d5ec2e7bed79d57b51ca4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 4a39f60f383a8b36843868d823972d02970f3574c3d064d5058ded9c49874ea4
MD5 090f1cba78c40b6c56261c04e87b0a6d
BLAKE2b-256 fb7736ac0cb948c0cb748f14475937ebd97fb97bb14a1078a7aadffa09e72c3e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 e533c20351719aa295ccc73863df546c90a1ec15dbbd7b0ffece83e8e1da9680
MD5 eeff25f0a575ffc8c120b584cb8954a0
BLAKE2b-256 cfdf125b01bc1059a37eeb7f46c8a9f880726a8e5eaf33fb7d99827f205911a2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 24743bdbad14812ae040dea329fa2fba118424a8da42e7bf05198bc18bcad299
MD5 fdec721a5dd49ac417de359234cc2e83
BLAKE2b-256 d45f17ad3e673cfccc692f3a6d3425115de1f58735682ce23e0cd0fdb01a22cf

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c3229b3b622bc5a1e1a2c60142560473052afe92c3fd9e2891ebdab739d135aa
MD5 b00529c1f7d38abb3a876a10a8182e36
BLAKE2b-256 ffd036acbc13f760adce6d48ce1378653ad46a7684d71782d30efe24a753c9bb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 e2f048dc595ee9ee5638d27754dce1ceb243b92ab49912a729396b4e3e5fdd99
MD5 476edf72085f4486b1e818f17f8e64e6
BLAKE2b-256 bdbcbb9c63a5dec8c9fe750a9a1abc0ef8865238750c7e0e1b1ee9e696f521df

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 ecb34882f0dac583f12f1307f24a9b3c447f64f1f1f4e560d5ef061a10291187
MD5 701c82b1b7f298676f84e7bdf710ef62
BLAKE2b-256 7214c1fdb1d552d08bbeb28762815f9e0fb0a57d495fdf250d8c4c870f7e10de

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 f6f8bf014221a983a7bdd9ed436e54c88d74ca8beb9b465967dfe33bb4e16a8e
MD5 903c6e363fe3386b22afec0554ec7dbf
BLAKE2b-256 cc9e16f2a9ce4b278231b11b8c3e617379615ee8300e99b6e31d80b1c38094bb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 03ccb38d75fd0e4bbacede27b09cdc34d3c70bd8874a2ea86781cb97b28680ba
MD5 da8f9f42253d0e88c161b7b2fe31d18c
BLAKE2b-256 524f3095cbd030b0f77887dc93943c9de3a803a0fd300f5fe441a7e66e43450b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.2-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 875d12259a5eeb83348545532ed01b2a56105dce39d88173402d0938894765ff
MD5 0e3fc3bc5284e4fa84d9871a37086264
BLAKE2b-256 0e8c655352339c58db556a83a253456e60c98e529048535157ef3639b94fd794

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