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: v19.1.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:

Alternatively, the workflow can be triggered manually:

On manual triggers, the following input variables are available:

  • llvm_version: Override the LLVM version (default: "")
  • wheel_version: Override the wheel packaging version (default "0")
  • skip_emulation: Set which emulation builds to skip, e.g. "qemu" (default: "")
  • 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.

Acknowledgements

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-core 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-19.1.3.tar.gz (11.1 kB view details)

Uploaded Source

Built Distributions

clang_format-19.1.3-py2.py3-none-win_amd64.whl (1.4 MB view details)

Uploaded Python 2 Python 3 Windows x86-64

clang_format-19.1.3-py2.py3-none-win32.whl (1.2 MB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-19.1.3-py2.py3-none-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ x86-64

clang_format-19.1.3-py2.py3-none-musllinux_1_2_s390x.whl (3.1 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ s390x

clang_format-19.1.3-py2.py3-none-musllinux_1_2_ppc64le.whl (3.1 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ ppc64le

clang_format-19.1.3-py2.py3-none-musllinux_1_2_i686.whl (3.0 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ i686

clang_format-19.1.3-py2.py3-none-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ ARM64

clang_format-19.1.3-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

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

clang_format-19.1.3-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.7 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

clang_format-19.1.3-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.6 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

clang_format-19.1.3-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (1.9 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ i686

clang_format-19.1.3-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ARM64

clang_format-19.1.3-py2.py3-none-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded Python 2 Python 3 macOS 11.0+ ARM64

clang_format-19.1.3-py2.py3-none-macosx_10_9_x86_64.whl (1.4 MB view details)

Uploaded Python 2 Python 3 macOS 10.9+ x86-64

File details

Details for the file clang_format-19.1.3.tar.gz.

File metadata

  • Download URL: clang_format-19.1.3.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for clang_format-19.1.3.tar.gz
Algorithm Hash digest
SHA256 f067d00d01903668196d5c4890f535ff7a118ed59ec0b8cbdbf11c68785a6a98
MD5 b18721110855d783b9dd22ae1b148f96
BLAKE2b-256 c674a4e2384a673b3ea1e57eb12f9d7c4b9dce162177fe8648a4a2fd252263f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9ce291c5e835146319f568fc0c5dee5a12ea32be9f2744261997870e50b4732b
MD5 0134381119990bfc306091e6e7d155c5
BLAKE2b-256 c5fb1904fc1a8bd080cd58f2ce50ed20245076122c17af61f7ee3370a90f7c5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 1cfab6132c257ee8020c9fa788b459793f423f872ff2af79a1ac3a2c80df8af5
MD5 ef2dffad339d5f3ef03baff776f655cb
BLAKE2b-256 9aa576025af44296bade3ccc71d3c3af1ba064a2073af7c202311556343062c8

See more details on using hashes here.

File details

Details for the file clang_format-19.1.3-py2.py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 553f2098ed7e841f137c646793418893bc761794e5af1b057cf04ceaeb37af3d
MD5 42e12a3e1f5a9992677d30eb718f4f46
BLAKE2b-256 321c942b4ed4ce72c0a50ac205d8d3ae9ee75e3e83cd8ccdd12f383d55bdb857

See more details on using hashes here.

File details

Details for the file clang_format-19.1.3-py2.py3-none-musllinux_1_2_s390x.whl.

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-musllinux_1_2_s390x.whl
Algorithm Hash digest
SHA256 996b30272803b2b80a223ed5c5337a4d73340c5a6a30034457b42bd43b3c1877
MD5 c9daa75144ef2ef3ada15632981bb2f6
BLAKE2b-256 bdab8b072251686b3c99685b9632067ee8344d25c0e8946adf1df8f8b5294cf1

See more details on using hashes here.

File details

Details for the file clang_format-19.1.3-py2.py3-none-musllinux_1_2_ppc64le.whl.

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-musllinux_1_2_ppc64le.whl
Algorithm Hash digest
SHA256 418517be67ac2893a77dc2f6f343c5a36c312dbc1ddd61c4b2ef0ebec603ddab
MD5 c078dcf9fbf040bb84620036d48d4c07
BLAKE2b-256 310fb161c330ce6ba521a98980d62ceea677ef5106fe263a34d359c71222dd0a

See more details on using hashes here.

File details

Details for the file clang_format-19.1.3-py2.py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 33cc6452a0fe0d7fde30f930ea81baab28432d5128fb6ad431d57fa7ae17f878
MD5 dacadcfcc4ec621787ef1173ba511f30
BLAKE2b-256 9fefb2f6db948188946ebc1decc3238c942c2ee07a44989b4ea3113032bca900

See more details on using hashes here.

File details

Details for the file clang_format-19.1.3-py2.py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 379768364419f777478442c45fd55324fdb436075efb2b448fad6f27688343eb
MD5 4f0387bffa58eb5456df9cb0b5da08f5
BLAKE2b-256 f307ff5315bcdac71c000cccd9de98618d1e9400e9e9fecf5dbfa72ea6984f21

See more details on using hashes here.

File details

Details for the file clang_format-19.1.3-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef7c248035886f11974882427f23a6135685e31da9668b606039184a9a911f30
MD5 97ca8d440cfd45e62e038b5f2b3eeacc
BLAKE2b-256 60a5019193fa2fa12e5c708fde7e7ac91853460fbee676179b872c7e10c0c3ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 98e0efb22638f72454bc6f1b3094e08f59a742743c95d8eadd2e90aa51a0ef5e
MD5 a3a8f788f5d9b11e8e259183cf149b4c
BLAKE2b-256 73bfbcbab1c1eb653b75e9f903a7e1c74b45bf30588778dde8668647fb591320

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 b1e7cd625d0e74311db0e888c040f3464850364535ac85d4fdb551b0644edee4
MD5 26550917b79189338afb14b51fb12537
BLAKE2b-256 ed162457a389d42e6c3cc14221a444e101b2776d85dce0ff23abea36ffeacb2a

See more details on using hashes here.

File details

Details for the file clang_format-19.1.3-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 10179eb0193a67af86295335e7e965661c2e0fc2d7e98e78642d7a3bbd6f07e7
MD5 b5d0645c5bd58cb4b330d72eb08d6570
BLAKE2b-256 789d71510b503b1307ca3303195644a622d4efdd1b73e17be3d194c6abf235e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7a94bcd46a3495bb5f7d08d4f02a1a012795b4e93120f4f44c206973693c2f5a
MD5 7fd3722e82334ab7316c7ccd0b9b2489
BLAKE2b-256 dedda04c581eb21893606f336a4a5536353623353c86cb6751c1ca1f7cb8271b

See more details on using hashes here.

File details

Details for the file clang_format-19.1.3-py2.py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 98af6016823a7b538bfb25dae33e90539cb661f1d9b38669514e32d82adab3f4
MD5 ea3991d4b6e3a17f6b5a0a0326194456
BLAKE2b-256 c6776040bb4e13406fd09997141a6ebd847df8ecddff3d1b55f4a4c18bd6cde1

See more details on using hashes here.

File details

Details for the file clang_format-19.1.3-py2.py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for clang_format-19.1.3-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7c6142542c3353f32d5b1edd589d84cd6a4c5e8d4813c9c6f11598bb1f9730b3
MD5 b75e8f89374aabb341681aab11f9173e
BLAKE2b-256 4db089842f8e7bfde6b9c0dbb809c2cb261d4b26e3157ad9f5bf2745921f0173

See more details on using hashes here.

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