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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

clang_format-14.0.4-py2.py3-none-win32.whl (833.6 kB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-14.0.4-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.4-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.4-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.4-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.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: clang-format-14.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 4092fb4d0908d82f9bcc4a772f44c3a2ad1e80b7cb0260d198d5ed5aa90d4683
MD5 d3574168ea491b5b465622be5cfbd1fd
BLAKE2b-256 0278ede75870de19c3658c60eace179233e048fb0e50fe3b68b8fc60434fc028

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.4-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b2c0d70359445914881378f5fcc5f24452a5d00b190b033da9013e2282197158
MD5 f461d156d97c2020df93dc6af3ddd2bc
BLAKE2b-256 0f715a6fa9be41c00bdfb05a5304cafc083b030476146bc9ad932db352b9152a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.4-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 78536c090bf747c34d8c12d6f47446c103f44b38aebbde11907b573561282ba0
MD5 400377d7a96ce55efe83e744f5f9c29d
BLAKE2b-256 94ddfb2eb2386a6e30f2579ef1520ddf99dc87d10bef347eced54048e4954cc0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.4-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 1685e98f71cdb6fb0120c64db484b9486b1c656b77b4664c944445494daa2205
MD5 fdffe88530544d082c49d68e7caf85ed
BLAKE2b-256 7356297aa4f78648bed477e921c50baba7f92f7926c54b4b9b1777cf39b6188f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.4-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 63913553822db2d7d776c9260a03c020d1053b686cba1ca05f2b5a8723a76905
MD5 43197a98364d2eefbdf51a32b26d4c72
BLAKE2b-256 0ec1ddf9ef4dc28e9d4e5b18a5910a6cfb61bc8572f867ac9d1ff762716f50d0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.4-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bb7bf4e5f68135f25eff17849d98e05ca92fbcd2189d37c1100dc5690064e586
MD5 7a1a8e2c5bc0d70be0d3b57b2ec312ec
BLAKE2b-256 52d101f5b70ffc3592c90c218c63cd404e1165d52662577a16f6b14863232ca5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.4-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 1a29c4cf2f33818be19341966b0f2b1bda753b7d74797f19d67989952145b5e3
MD5 0eadbecba79056dbb3e8081adf8da91c
BLAKE2b-256 56c68b18231e03cad53d2c15f69a0ce356481531cec7639f5e375e3c95e425c3

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.4-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 444dc57ba0fcfc9ef1313e0fd47c8ef16b94dcde9239535dede75de136e01614
MD5 932cc12f9c5959488f9728af913dd4d5
BLAKE2b-256 d0f63114aee07cea331bd4a89226f587ae76f696c209a50618bf3613a13ea3f0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.4-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e81a2585865b164c11440a1b49c3989c0748cc5ea97bca9f5b24ad9fd7dc3d80
MD5 eb6a52497c01e53535e9cda396aae964
BLAKE2b-256 8fe94e15de1e3f9f4c5c4e66537304f226621b9752ec419624a0fd5999df754c

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