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: v13.0.0
  hooks:
  - id: clang-format

In contrast to many other pre-commit hooks, the versioning of the hook matches the versioning of clang-format. You can choose any released minor version of LLVM >= 10.

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.

Acknowledgments

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

Uploaded Source

Built Distributions

clang_format-11.0.1.1-py2.py3-none-win_amd64.whl (910.6 kB view details)

Uploaded Python 2 Python 3 Windows x86-64

clang_format-11.0.1.1-py2.py3-none-win32.whl (742.5 kB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.0 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.7 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.0 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ARM64

clang_format-11.0.1.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.0 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.12+ x86-64

clang_format-11.0.1.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl (1.1 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.12+ i686

clang_format-11.0.1.1-py2.py3-none-macosx_10_9_universal2.whl (889.6 kB view details)

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

File details

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

File metadata

  • Download URL: clang-format-11.0.1.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for clang-format-11.0.1.1.tar.gz
Algorithm Hash digest
SHA256 b4d073d1809f8aaee9183d5f9843abe4b070784a89a074a7fa5a59739a250f0c
MD5 e8dab1931f5856331a4a690c98251f06
BLAKE2b-256 ec537109816f964f69115627e4c63ddb6c96ffd67d93251401cad4a60c7974db

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-11.0.1.1-py2.py3-none-win_amd64.whl
  • Upload date:
  • Size: 910.6 kB
  • Tags: Python 2, Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for clang_format-11.0.1.1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6f3cbd3fe116295a02163cb7a188144a72d97587f14daaf8b152db3889920af6
MD5 141dfd189bea45d2147a7ef8149ac6fd
BLAKE2b-256 b728e7519e2754f41dd64db5491cae7df47dec08a4617101dac94496dc32dc7d

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-11.0.1.1-py2.py3-none-win32.whl
  • Upload date:
  • Size: 742.5 kB
  • Tags: Python 2, Python 3, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for clang_format-11.0.1.1-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 2c120fe194a9d16f451e30e2279ffa2394cca05e97e339d4a356b8f3b2a99ef7
MD5 d193e9b653fd0899ebf0584eb1ed1098
BLAKE2b-256 6581aba3b46668c8c1fd150343275a2d26a6b3010372249a26cf848ff08613f3

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.17+ s390x
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 b52261c86436870a7385a4bba513570629a04d1a0cdd2fe5561ea56972224cf5
MD5 55ab6e39687f6a175842bbb3fa19df78
BLAKE2b-256 3c62256f565ad6c672e7f130f7ced7b3f257571ed03367c13304ba867ef682c8

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.17+ ppc64le
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 3a34b43f416d55e67710caee4641b2be4d514f559884edd21db432da51bbf881
MD5 97d98ab3125e4c2dff04b26b44654252
BLAKE2b-256 2173f8808e3751ed490d1c2524403b05d7bbe3efb34b1b86564f058650de1fa3

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for clang_format-11.0.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 197c63fca53608114a54c1a0d0dc822513cfd8ed6129184ee7c46d570e12e0c2
MD5 daca5d0db8cc3a78feb750a6639ac056
BLAKE2b-256 07a2a5ec8aaa841901d31f44b46e69ce38eb954f98dca7c7e1a6d5f5025948b3

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-11.0.1.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

  • Download URL: clang_format-11.0.1.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for clang_format-11.0.1.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 022eec1067db92375e1c031059f5202309e9b458d30fd694c69c0da33e1b17f4
MD5 b68fe7d9631dc888af7f71849826f4fd
BLAKE2b-256 9b5c71a87be95e73097f2103843206d5ea9637692638c0877fe19877facde6c9

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-11.0.1.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

  • Download URL: clang_format-11.0.1.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for clang_format-11.0.1.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 8f35614c66e848f584bee67b65611849a2188103d8f155229eb5bcd3516b92f1
MD5 c40b82f2bc5974bc567e854e0f179542
BLAKE2b-256 10253e158143713530d888fb91da6765b602a11dc0b92837155f5f1e1b8b88e8

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-11.0.1.1-py2.py3-none-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 889.6 kB
  • Tags: Python 2, Python 3, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for clang_format-11.0.1.1-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0a0ea9807703fc30ed3bd2380258aa6f20ed43da0bab5365e952dbce9537025a
MD5 db41ac46223b64f02ba1266e22e909eb
BLAKE2b-256 03df347ae0aec365dc9431fdbacd059855e8988f608757c8241a6d26f0b44370

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