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

Uploaded Source

Built Distributions

clang_format-12.0.1.1-py2.py3-none-win_amd64.whl (809.6 kB view details)

Uploaded Python 2 Python 3 Windows x86-64

clang_format-12.0.1.1-py2.py3-none-win32.whl (641.8 kB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-12.0.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (948.3 kB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

clang_format-12.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-12.0.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (953.7 kB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ARM64

clang_format-12.0.1.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (921.0 kB view details)

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

clang_format-12.0.1.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl (1.0 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.12+ i686

clang_format-12.0.1.1-py2.py3-none-macosx_10_9_universal2.whl (803.1 kB view details)

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

File details

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

File metadata

  • Download URL: clang-format-12.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-12.0.1.1.tar.gz
Algorithm Hash digest
SHA256 6bdc9f70f9e384bb5e238f2f6859e0719dcc5caf1cb6c7e61b9670fc42727297
MD5 5d0737f58fe9600a8adaa404b62e4c37
BLAKE2b-256 4372689b399d5e3461c36c8a5709c14259076e9305e3b14d7912ab0754a9b529

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-12.0.1.1-py2.py3-none-win_amd64.whl
  • Upload date:
  • Size: 809.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-12.0.1.1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 89c0d0dd644c930e68cd59c99c3822569ca7d1acb131ef65bda9733b2746407b
MD5 53a6d39f24fd64384eb447a274ad51cb
BLAKE2b-256 7cba0bd4789f46d617d0df9c3ca7bdaeab1cbe9b0ccbeef437900b75ed4fed78

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-12.0.1.1-py2.py3-none-win32.whl
  • Upload date:
  • Size: 641.8 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-12.0.1.1-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 4e3631ed85589b71a491590845048c58815c6bc45ba19958ae1a61e830366bd6
MD5 60330b994cccc773e365eb384d26b41e
BLAKE2b-256 2ff377622e1014d141f286464fe7a6070407bc39e53b7aec967bc63b4fc6f613

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-12.0.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
  • Upload date:
  • Size: 948.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.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-12.0.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 cd8cb6c0587eaa0367fe50af9cc03676bce55daf33fb98e7ecfd24a1cfe7965c
MD5 b430cb92ef7198ec148b0a3202d8a41d
BLAKE2b-256 79c8778eb2bf871af26ccf417d8279e10a022ae4222898dbbee4e576cddb9b9e

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-12.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-12.0.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 1c2a5fb8c1f863008f0413b3ddb4713564fe3d396bd51e74ea8b75fc0a77669b
MD5 dc9bfb0df556981155c37d9c6dcdf408
BLAKE2b-256 6c5a4e2a12a045f7ada09398f9beaed7d37555f36d08a352c10401ccefbf8aa3

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-12.0.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 953.7 kB
  • 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-12.0.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 acc7878471d6f12800ada339c2ddedc4dbff64af56cb787ae2daa687f9cd5606
MD5 f583121c117edfa4aa1f0f4b63c50ce0
BLAKE2b-256 a3020058414c6991d9254be1e59fa1bb0a8e373a5938e21aad81351989a7a264

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-12.0.1.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
  • Upload date:
  • Size: 921.0 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.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-12.0.1.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 312246f973b2e0df52a6d59085610ebe48de216af1ba3b9a3ac1f7dc44b7491d
MD5 979241da23aa6e961d50db77bccd70cc
BLAKE2b-256 976209e28616eeb4311812ebb46c14ee942d7e1e27dea17eefa8212f34939ae6

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-12.0.1.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
  • Upload date:
  • Size: 1.0 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-12.0.1.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 967dabf0ef648a5237f908d039d9e4969474451621928c663ed6196505b2826d
MD5 91466ad644b5c027f4c5f1e6d23d8515
BLAKE2b-256 3263b07a00a5f4df92196dd0e36f2b5e801a6de6059be13835db8b8e16201b77

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: clang_format-12.0.1.1-py2.py3-none-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 803.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.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-12.0.1.1-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 93ad8524f76853baada61236444012894e34a738dce8094d3914af0e043e1712
MD5 d94c2d7030e17d4f74fa933dab46095d
BLAKE2b-256 540532361da7bf4460efc0a5847cc782a68120222a82854bce3db7f28069325b

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