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

Uploaded Source

Built Distributions

clang_format-14.0.5-py2.py3-none-win_amd64.whl (1.0 MB view details)

Uploaded Python 2 Python 3 Windows x86-64

clang_format-14.0.5-py2.py3-none-win32.whl (833.5 kB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-14.0.5-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.2 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

clang_format-14.0.5-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.9 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

clang_format-14.0.5-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ARM64

clang_format-14.0.5-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB view details)

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

clang_format-14.0.5-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl (1.3 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.12+ i686

clang_format-14.0.5-py2.py3-none-macosx_10_9_universal2.whl (1.0 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for clang-format-14.0.5.tar.gz
Algorithm Hash digest
SHA256 d83a7e4b3c50f2e8f75a7cb5bf52073819a0b6ab940874d822a9309a339a3058
MD5 51afab0518b5b7c93a7d2f3722708f61
BLAKE2b-256 6a8759296b9a06597a52bac498adfa4a2f37ce17afbd7d59efe616e9d0fccd99

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.5-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a719ac9e3ca17e1dc2e01015cd90b6a590f5362ed60d1d533a586338f1bcbc8f
MD5 401aa77d9ce4af2f5c2bc995daa94513
BLAKE2b-256 746a940d3f5f45fbcacadbcbc9afe7ffa2a33d3c6b755b51bcfe26190dbb3a9a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.5-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 198a0106ededdf85592bf4e16a3a270f0d016b39024ef041c197e23c421b342e
MD5 e7a07d6e838494b599028ad3fd2c30f8
BLAKE2b-256 22767f31f115dd7d75f5c08e37c6b781a4fa5da5e1f55eb9b8db906745031def

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.5-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 0108edf03c4ab390d8e455a854af512d79c9bfd92f8c4ad67ea0aebea70b96c2
MD5 d06e317fbf6dce087dd1ff8293c5cbdb
BLAKE2b-256 e8b4c4d7c8ff003a33c94587a9c6410508c718d60ba4971cacb9e40a33b89754

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.5-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 39bf624052a6e0fb8097a6e121f1c24c95f0e000349aba2240df750db28d60df
MD5 53c083cd6187d9065c6c0da3ba079c58
BLAKE2b-256 b79a00d74fdbea6cbcd0ec3eccd84dee0f5b5649fa62950a405b35167f052465

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.5-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 88e742ff6b405edebe26734b55f09cb78f3dc90d88212913f889c7f9559c585e
MD5 092af725d7bc7ad4260b9c0eaaa21742
BLAKE2b-256 3f38e7c5d73e44201ec2bca5915fe1806cc1b05a26fe050609fdca98d28483e4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.5-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 77d9628921b88bbf0fcf9f0f9ea0cd0bee59466b2059db506f448fb06ffc5db2
MD5 161fce35d08313272fd60ddf58575db5
BLAKE2b-256 9c05c9433b3663735a2e85651b90ae7d55170c7f6f9a250fe19f5f9b989bea85

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.5-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 0cda65b8eb7a87280186998336321335e6670cad6caf1078b28d19230025a635
MD5 fe2de4e9ce37f72d7ef408d66df7eb2e
BLAKE2b-256 c99e3023d7e9679656bef2228299ccef0a4bd03996108bbc915bc9372f15462d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.5-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b1d1de39f399128a9cfc6d1d66ce1e29690f1f35e0b351bb9083f03fffd549f6
MD5 23f9fca6f508cafa14bfd0f783e9156b
BLAKE2b-256 2a044816cb026bb7fb1d2f3d6262c97c4c9e93343c6cb0810e0ccbf9c55fd8b8

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