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

Uploaded Source

Built Distributions

clang_format-13.0.1-py2.py3-none-win_amd64.whl (839.8 kB view details)

Uploaded Python 2 Python 3 Windows x86-64

clang_format-13.0.1-py2.py3-none-win32.whl (659.5 kB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-13.0.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (983.3 kB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

clang_format-13.0.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.0 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

clang_format-13.0.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-13.0.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (960.6 kB view details)

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

clang_format-13.0.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-13.0.1-py2.py3-none-macosx_10_9_universal2.whl (832.1 kB view details)

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

File details

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

File metadata

  • Download URL: clang-format-13.0.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.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for clang-format-13.0.1.tar.gz
Algorithm Hash digest
SHA256 deb131bee8716aead66f0bbf64126cb9e18499d18ea75801dda86ff842320142
MD5 02472b77651c56db55400c48d2906d89
BLAKE2b-256 0f6a46e36463d43cbe6aa0a87a09f440fff380352b106b5d0747b23c33b38df5

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-13.0.1-py2.py3-none-win_amd64.whl
  • Upload date:
  • Size: 839.8 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.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for clang_format-13.0.1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 7b80a328107bf3d11bf2db7d227feac46458aed07f836430d8dc2155dcc5cdce
MD5 d2ee5289080bce234fc9decdea03f5ab
BLAKE2b-256 f400dd7a74b5dddb168568bc40042f2c662f2b748dea6242396c5d9f2351f777

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-13.0.1-py2.py3-none-win32.whl
  • Upload date:
  • Size: 659.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.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for clang_format-13.0.1-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 1302ef7522eb9dc1daf270cd5a4a1f10814403e50d74be9b96f87dcb200f47f7
MD5 182ec992d01e5e49fcf4228151fa4a8a
BLAKE2b-256 93b4ab636facaec6e98f87e90fa632b600179fa5f890ca440be88fa188e812e6

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-13.0.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
  • Upload date:
  • Size: 983.3 kB
  • 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.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for clang_format-13.0.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 a6e0ea97648ca916454f9719537d16a4ec5557d8644e544a001aaa42ba9b653f
MD5 ada92a1725554cc39a75bd424c04dfee
BLAKE2b-256 a697876beb4598e26b4df5f3256aacea77f6d495385ea2e39888f041af965be9

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-13.0.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 2.0 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.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for clang_format-13.0.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 f345b61c56d76325b158dbad560c35bdd8e77184f0fb60aba4f8019f744b70f8
MD5 de013ac16be75f95df146891791ae37d
BLAKE2b-256 9e9bb1447c3fca9a9efeede9542785982468a4c9a57dc6db000d6adfe87f338c

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-13.0.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.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for clang_format-13.0.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 88c832f055ee1d4b026a819c9d457374d92abe067d8f87078b9f229e6564ac1f
MD5 a147e82b603ace1b9b6322dd2fa8c466
BLAKE2b-256 ca9b7f7a8761a08f3ef462bb1c062616a549f76c80b8fa942d068656a54665e4

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-13.0.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
  • Upload date:
  • Size: 960.6 kB
  • 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.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for clang_format-13.0.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 58e91debc2b2d14d174c73c678ffac676cb171152ee3f4239b6cbe6975e4ede1
MD5 70d599dc9729c20216c01755857cddfe
BLAKE2b-256 17fd723876a1e55397e4b060f2e9e3d4a5e4820f6e09ea05fe8c8cf4ddfd1ae8

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-13.0.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.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for clang_format-13.0.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 a8fab9bb9b96be6024a2d6e686894cb5725001399ef04a51383cda551e354c3a
MD5 ecd5b3451dbab9b94c967dc8a87979a5
BLAKE2b-256 afafdd02567f60d1be34819d1f7e8958ef786850c062527d1f2343e5f16c746f

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-13.0.1-py2.py3-none-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 832.1 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.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for clang_format-13.0.1-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 826d487b1cf0190e0c3a5e064b56e2f6e7c4c799c78e59ff6d8991df916f2222
MD5 263a1ed509cfad3949400ee2665342c7
BLAKE2b-256 148e93bb3094512d6bb515c28156373ac6cb786e0cc08ff6492aca0fc7d592d8

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