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

Uploaded Source

Built Distributions

clang_format-11.1.0.2-py2.py3-none-win_amd64.whl (915.4 kB view details)

Uploaded Python 2 Python 3 Windows x86-64

clang_format-11.1.0.2-py2.py3-none-win32.whl (754.4 kB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-11.1.0.2-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.1.0.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-11.1.0.2-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.1.0.2-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.1.0.2-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.1.0.2-py2.py3-none-macosx_10_9_universal2.whl (889.9 kB view details)

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

File details

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

File metadata

  • Download URL: clang-format-11.1.0.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-11.1.0.2.tar.gz
Algorithm Hash digest
SHA256 62b21d3f5e476914480e8c08619a5c7caa257d0364ea8ea5336aa7cc6d677137
MD5 a02b4ea3cda7a1467d34e02f99c517c3
BLAKE2b-256 06ecd5847e1e4969999080e61255295c42d2c507fb94e0415cd1bcbcaab0113a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-11.1.0.2-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1711c8475d4a018b90a2438a6921151b11f5814b6cfd0dc568ff627f3468fc86
MD5 358ac2b5c786dbdbcadb77b37c4a443e
BLAKE2b-256 91b8462d711344dd1b907b0cb3cbc32b14c1aac20d0b98245a5e48a5ee499148

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-11.1.0.2-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 84a193a6c54e5e5331cc170ed84fd085dd6c02a515ea8996e5d344054df3616c
MD5 d8591da04762ef73a977927f7225f4f0
BLAKE2b-256 4ad9f6212b8f809b58f638d8503580f70afae2e0f8cc5f5180395e3a935ae45d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-11.1.0.2-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 0d93fb322e2df24f756e2829f199f8f3eaf5f30e5e0e869c1783b8cb46adc566
MD5 0d1a78075aea8cb1072bf8bd6fc6021b
BLAKE2b-256 24844a67f55ff8e2f0a0f0a05fbc1d907e381024dda75af2344b8084b791ad2e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-11.1.0.2-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 414064787e76948af0c12c7508329418b9b6d451fb717626c99c0afea9cc1703
MD5 19ede0a6ccb3f4080421d3cf85179d03
BLAKE2b-256 38863dc04880e9b07d11fc0cd1ef6a6e7eb601fa0cd0e438071e52ff1d00e258

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-11.1.0.2-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9ad459aa482b65db737f63c02ba572d0a88fc20418e79d2d2e43f9e503b2c572
MD5 0a632c19ca768118d80d72e3113276e2
BLAKE2b-256 23371d2944c2cff4daad30fbdb589ba67ff8ae2ef92e8ef4e9abfe7db473d252

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-11.1.0.2-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 766f3b3cde18e3b2118baddd5b348059de4b9d0fcd39cb33cc228a28e8b07a98
MD5 d63001422df37bb7d1c70a8ffcf98d81
BLAKE2b-256 b4578b83b9cfd7989eecfccab6400621215f7a7f6c337e22491d70fea5b3336f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-11.1.0.2-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 11cb4c357466ca64b64ecbcf518ec0a3a0d10ec78eefa2428ba4efa5af414a17
MD5 f200f416cfddf3973dbe683ffbda68f9
BLAKE2b-256 6f664cf68f53fad7ba798a06a5013080a1e81f36ea7888ae8555e99cc1fee71f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-11.1.0.2-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 20fe347c657d3e0649c8a332506d70ed2c11fc54af121ef455506df2ad79f721
MD5 740753cf5a9c8a3a9b01bc4866efe316
BLAKE2b-256 654930d3b2d22afca814264faf081b138c160544384b6aa7b11a0bf7a4a37723

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