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

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

Uploaded Source

Built Distributions

clang_format-17.0.4-py2.py3-none-win_amd64.whl (1.3 MB view details)

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

clang_format-17.0.4-py2.py3-none-musllinux_1_1_x86_64.whl (2.2 MB view details)

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

clang_format-17.0.4-py2.py3-none-musllinux_1_1_s390x.whl (2.2 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ s390x

clang_format-17.0.4-py2.py3-none-musllinux_1_1_ppc64le.whl (2.5 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ ppc64le

clang_format-17.0.4-py2.py3-none-musllinux_1_1_i686.whl (2.3 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ i686

clang_format-17.0.4-py2.py3-none-musllinux_1_1_aarch64.whl (2.1 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ ARM64

clang_format-17.0.4-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

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

clang_format-17.0.4-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.6 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

clang_format-17.0.4-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.5 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

clang_format-17.0.4-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (1.8 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ i686

clang_format-17.0.4-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ARM64

clang_format-17.0.4-py2.py3-none-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded Python 2 Python 3 macOS 11.0+ ARM64

clang_format-17.0.4-py2.py3-none-macosx_10_9_x86_64.whl (1.3 MB view details)

Uploaded Python 2 Python 3 macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for clang-format-17.0.4.tar.gz
Algorithm Hash digest
SHA256 b8513e927c8e0caaba83be8d065f8100ad94415cd1cb2945127debe7bb368de0
MD5 4063e4207e9b269c21d41c243863bdd4
BLAKE2b-256 98644084127c8c5f28cb2b4d079ef9830f7f4f2ec80f612bd9db669ac41cf4ea

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 53784f6503ea58ae63e449a0eae83073ddbfb929adbe24567c405d3678797479
MD5 de6851799aca82e30ee43940b864c616
BLAKE2b-256 bea6db78dd55ed2da0fe9c4ec86cb3498ecbb8be19cc39f9d45b7bc9da03938c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 839446174c207535eee34a3d9f2aa94455547926a4ebc94d59abd84f8ecee229
MD5 c6c73244a8395302893397a0df310f38
BLAKE2b-256 a72e208939da88d112a1ec2b47b4abcdb029e39548531db31dd750930cf4a78e

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-17.0.4-py2.py3-none-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 9e2a8436c3afab54170ad1d22561cc075034bc46a510ba528b488b459b367df0
MD5 0e216aa527d36a0e6fae611ddc285442
BLAKE2b-256 3398fb3811bca772d986d94c112e684b3ce20a0d40024a713a811ebb25bb7f80

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-17.0.4-py2.py3-none-musllinux_1_1_s390x.whl.

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 557fb96bbafd53f053ff36f87c88193762cdb0f1d85465e7ebb3752014120f01
MD5 0f88e5148db9c57ae34f5b7e7288836b
BLAKE2b-256 203a705156f930bb005867aeb0c2cc2140ba511f2afe3096619ce658ec97f6ef

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-17.0.4-py2.py3-none-musllinux_1_1_ppc64le.whl.

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 545c599913e00ed4c06677c123658992131bb7cf6cc5e1630a8e2618988811ca
MD5 313e7ecafc48f12f9131330a3dd449c1
BLAKE2b-256 e2503b310e952997c99e063b73ce86332505298d2e3811ab42e814a2ce135849

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-17.0.4-py2.py3-none-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 b820e6eae19a215302db3dfb847c2838851a2c9a52952504c6c5ee1e1de2bdfc
MD5 6ec2b758a8eae8063c817d8a2cdb4cf9
BLAKE2b-256 2b361e88e08d837990a03570ce507cf2c43105f520c8652c6b1c5b97b2dcdccd

See more details on using hashes here.

Provenance

File details

Details for the file clang_format-17.0.4-py2.py3-none-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 3d2b3468a048bcd31514b72aba61997a77a73bd0272f1cb80f9baee585114aa3
MD5 cb2cdedf33303b8ff6ab5dad4dbc69dd
BLAKE2b-256 267b26eb135eefa5df7608a7bda181feac8dcd2185b6207bbf25bf2e75f4dedc

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6e12e95b27dff188ee50e83e7fb565eecabded57d256ca51c53fd082d2363c3
MD5 670885869448cade51410784214cadad
BLAKE2b-256 77c97db6892e77adb07dde8bb23e753208aceff354407cb447018e235474209b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 65f79fafcd27281a5c4e1d83c648202f5e7ec4a0b080697906204c9b896c930c
MD5 341137f026fa13df076f5a7cc9b21819
BLAKE2b-256 93978ada427b29f3511bd7759ab435f773494bf53a2b46f82a0060851fd3ff34

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 67e670505da1b0cb5a454ff84ad1fc030552e457177516426f669fa46301893f
MD5 8dc8193f6406c1de57542b978cf82214
BLAKE2b-256 bd789f6be556aab62e38a039d5f99accabea0d5a9c3bea7166e701b45cea4f4d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 9037927dbe50588c6056c333898c42c0ab9ed390a3b28565692fd587d5885da3
MD5 52731d41673e078fa4210c2294654586
BLAKE2b-256 20b606d14a80dee1de4ca229e0dbeca84e95d4e1c1e47e1d86472559b0df5ab8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0dff69572d0c5af484430e8825f2c9f753f55f2b39ffa1376e71502b1ac7c405
MD5 bbdddb94110f02b92eb264cad8f7274a
BLAKE2b-256 c002370555b2dbd00b6fc59a48a84ed25abae937392ca3017848d5205aced832

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad293c300bb2613212f41b0667cbcc4b118adb6f7f0d11617937d76fd2350226
MD5 41884abb5db28f3db09b2ffd6c85b517
BLAKE2b-256 93bfa9d3cb7695219a348a4229c880b4c09530fdd855fceec1d8079ca153ac74

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.4-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 309173b909135c849ce17057a3b30e2c6be004bfcdeafe9d9628efd2f43e12cb
MD5 2e73bd68058072ab5d062527f6f932d8
BLAKE2b-256 58271c18f1c492b3d72e19ef4533a4caa1410c76085c3448dc81aa3fb85cd682

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