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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

clang_format-14.0.0-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.0-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.0-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.0-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.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: clang-format-14.0.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for clang-format-14.0.0.tar.gz
Algorithm Hash digest
SHA256 60c631c990bb1fa2a20fb60c581560dec9c37ffb575e616fe9c05d45bdd3b407
MD5 05ba766907d1230cfc44f549ef190416
BLAKE2b-256 6fd3f1608c2226344901b0e88f977a9163f198ce4c8280a9ad3173a932c48adb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.0-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d240f29f6a4a5e4c47af3ee37ac4ced4b5e71756c74cf3b513f0cb5b0de69d7d
MD5 85eb468f901e8832aee2396dab303a60
BLAKE2b-256 b363b82289b40330ae1ffd112b836f531cca1b43600dd8440ae66face8b5e1ce

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.0-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 17de21387ab5676daf265303b4a4bfcb1e9e886c62900e59a10b6e332fd210cd
MD5 af38859041041de3674b69032c8fa6d8
BLAKE2b-256 73304ec4e957c07e3bbbab625b1252781864792fa5ca8d17f6ce1955cfefd08a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.0-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 5384ec3880e2000e6c06884542d6ab217f8140f3ca142a63ec16ddf21ea95965
MD5 8468848d944f8fdf83962a40b98c3a6f
BLAKE2b-256 1c2b139402d516d10210834b3d4b4db5a41be9101e16cd8c1db0ec1f6a7ccaf5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.0-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 e6e678ac8008bf77de79a1c1eb9e30e7076bc22e52a1ba122a356a24c97715e9
MD5 4a04dcc2c6ac9ef27a2e1b9ed09a019a
BLAKE2b-256 fa8735db0a1060e8989c3b62ce030a87a0285e76637634949d398f6be61f9bba

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.0-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 580456c55436d6e4f236c4463ae5fd74948890f7379b502069467f0b0f4f130f
MD5 497b5c50beed5d7094351534e7ae73a6
BLAKE2b-256 40d3ff0dbf8bfb0c1388870ef147616688c96d58578b0d478c362742a742baea

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.0-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 85c6c8078645eb14a52dc64ce122bfa992f51cc4066580e4d670bd15c0c07500
MD5 8bc53f225c5b7b599e57e9f06cbaa8de
BLAKE2b-256 c069bf08f34219f6435dfaf0e29cf9afd7d815b10307c7e0394c2d3a43a0305c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.0-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 b1fc036e3c419f867660d91c4bed56de76d5e2f076b68449c45f2fcd81e3049a
MD5 60df250faab9ae5d5bba9e33da587be7
BLAKE2b-256 cc19d25455ea5ba4ea508d1c49cf2cc2d30e287e10ea13e91ce2ed6300985d4b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.0-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2a75cfa5ce1ce77fea9c24d1a249bc8e07b3d62196ba96755e4fa4ef1e3658f7
MD5 83043d3eaa58ad07d6aa2ea1f1022484
BLAKE2b-256 7bd1889e81e8504452f3a78bf5103d77dcb7201964fcb2b5850a84ff6327bf90

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