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: v15.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-15.0.6.tar.gz (9.7 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

clang_format-15.0.6-py2.py3-none-win32.whl (1.1 MB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-15.0.6-py2.py3-none-musllinux_1_1_x86_64.whl (2.1 MB view details)

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

clang_format-15.0.6-py2.py3-none-musllinux_1_1_i686.whl (2.2 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ i686

clang_format-15.0.6-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

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

clang_format-15.0.6-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (1.6 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ i686

clang_format-15.0.6-py2.py3-none-macosx_10_9_universal2.whl (2.5 MB view details)

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

File details

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

File metadata

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

File hashes

Hashes for clang-format-15.0.6.tar.gz
Algorithm Hash digest
SHA256 09dc33e84130191b6d84a90f17eb1908d66ed017996286cd73f8bc8644ebcaa3
MD5 fd641935d50dec26b483badbe6854572
BLAKE2b-256 ce1401a1a757f889b7d696c7a4fca990debe500512bf205b95c92431242d26fb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-15.0.6-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 391de75991a659605a8c9541aa0c2521ddfbf49411115ce9dd6b6ad048048775
MD5 e72fe4ba4189586e411210c481a06fd7
BLAKE2b-256 07afe267ccb3fd48caa626b4c0b1d576a9203294e6ab22ca0505e5895e492793

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-15.0.6-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 11726ce980911c69e9ae6b5cff8e2b929f5b6ad6ae2b8e1d22c0a0e4ee181161
MD5 ffb734223a686cb867a99e3388507f8c
BLAKE2b-256 d273150cb4afcbc1eaecc00ab5f006ee2153dda37347a8907b9da0c876cd7d7f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-15.0.6-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 486fc960fd13e18c9ab6cedac319ba44aa062a32eb34ff745575da0e21efd3d3
MD5 4b9fb635cdd22514298d00224a8e70d4
BLAKE2b-256 a7982539eb64b79838b1bc96373777978202558ec0e3354b145642e3282ffbcc

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-15.0.6-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 c7a35fe24c9435a4e66920820c8fc94870616320aad0da0ded8e11612da7f50f
MD5 e6253e1ee7a3e09c6676ffac5753b43f
BLAKE2b-256 0fa4b7b44dcceb20e2861234d3991017bc4c9a6a7427a9828f00fe4e9e6339e2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-15.0.6-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 264185941e5cc8a365f0a46053ecb1cc10faa09528046b239b0e656daa25c9d0
MD5 e3cf01aec5b303a07ff0df2e9550d9cd
BLAKE2b-256 403b1da41bc391e8d3d82827450e18b828ebd1120718be50d3c35d8e19b8d97e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-15.0.6-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 7c3505b805b566d134c23b4b77c9c7995fb05b8ae219dcd3198240d8596588e2
MD5 d57b54bb6e6811c6f8a6a0ea02c162bc
BLAKE2b-256 d139eff35181f4c92f999a8cbc529ef0bd5600d728aecff160bc26ab0e538aaa

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-15.0.6-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4a5e12fdcba54eb2429877577f5ef5c1cc00b2673836d9c68f80012736df2d6a
MD5 8741befa05c7dba0daaa5413b37a2a0c
BLAKE2b-256 fae8dab76f74ada8dd7002f5a415ef340a7b0bab7637c7fe7ed0260bf702089e

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