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: v14.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.

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

Uploaded Source

Built Distributions

clang_format-12.0.1.2-py2.py3-none-win_amd64.whl (812.4 kB view details)

Uploaded Python 2 Python 3 Windows x86-64

clang_format-12.0.1.2-py2.py3-none-win32.whl (652.4 kB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-12.0.1.2-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (948.6 kB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

clang_format-12.0.1.2-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.2-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (954.0 kB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ARM64

clang_format-12.0.1.2-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (921.3 kB view details)

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

clang_format-12.0.1.2-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.2-py2.py3-none-macosx_10_9_universal2.whl (803.4 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.2.tar.gz.

File metadata

  • Download URL: clang-format-12.0.1.2.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for clang-format-12.0.1.2.tar.gz
Algorithm Hash digest
SHA256 ed8e9ba912f458a259fa0e0ff7fc8c15caf8a7adb61f2d5a5c60eccb575d6e10
MD5 72aa0dcc54c4925f0a87d6c0b658f76f
BLAKE2b-256 551c51b30e3bd02bdce759190fe3d57abb1da7712cb1ce4dc6230dddd6f7488b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-12.0.1.2-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 8a6d1d11cf11b4ce735ea2622ca7995892e262b9786762c9c3fef6a4ff2a99de
MD5 f928c5be568b2c4893d947048a32ab70
BLAKE2b-256 6139241c4dc0fac78e03d9fbfb6306cfb9e0558be3eb0b04b37790b69a7fedec

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-12.0.1.2-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 a7d027b205f8b853567bd906ef0790756455cf7910f8c2ce927198d0db78c3d4
MD5 beebce77a74df303fe3736fb49456c6f
BLAKE2b-256 188adcdd173f7bf4dff5cab4bf200e46ac2ea92ab7ed9abb31b2e64a3bece70a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-12.0.1.2-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 96b18dcf35033566c833f5df138a1020047b1e804e8e11e6aa289c281d348f6d
MD5 5aa4c4377780999d80260622ec6f3845
BLAKE2b-256 979416630ae179a044e1797f349f18227f78af987b7cf320bcfd16ed8864bf81

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-12.0.1.2-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 13466a4a2be53e8483687a3c4218492037bf53a1d82e12a5e7277dc43b5d6c92
MD5 bc42fcaafab57868c2e79f91ed6268f3
BLAKE2b-256 bc6147a969c457e719b558b425c8ff571a60df3815f9847d9fa21bf72082f939

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-12.0.1.2-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1a43607dda28dd52369801ca5249aa5f676fdd719f7a2563678104d7bf727606
MD5 5b4c29128e511c0148564ba656cfcc18
BLAKE2b-256 8fa630fc3bf79504318967ba2c88183122b3d20dd5776a36ba84e776d0c02ab9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-12.0.1.2-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7ab0c1bae5551f6fea3a41dbe88fb653b11f86b802a13bf60c8f181e996f7c17
MD5 51acd03e0b5d3655856a8342e8631157
BLAKE2b-256 c92c36fffbb1af389b00bfb9304792aa7eab318dc485cfd69194c718ce13b463

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-12.0.1.2-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 7387d926c773dec22cbf090ee9da533f61b881e274f565b97047e99500ae92db
MD5 a61082d630a2fb90ae345bbd55e6db42
BLAKE2b-256 edfb1455c947ae9780ebc50b679586f85be8f4ef2bda128a5fe0520c7f34cd67

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-12.0.1.2-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 855a5cdc2d88ab046b165320311122a14369ef3d2e5e1ed689251a90e6cd76a5
MD5 043fdbb0037cefd10b5f9709e5bb03c7
BLAKE2b-256 5ee6a6c82f965f744ee6401334bc88c3e88358d30f6f130f9d8ad5439762586f

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