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

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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

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

Uploaded Python 2 Python 3 Windows x86

clang_format-16.0.0-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-16.0.0-py2.py3-none-musllinux_1_1_s390x.whl (2.1 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ s390x

clang_format-16.0.0-py2.py3-none-musllinux_1_1_ppc64le.whl (2.4 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ ppc64le

clang_format-16.0.0-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-16.0.0-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-16.0.0-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-16.0.0-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-16.0.0-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.4 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

clang_format-16.0.0-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (1.7 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ i686

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

File metadata

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

File hashes

Hashes for clang-format-16.0.0.tar.gz
Algorithm Hash digest
SHA256 f8dd028e10e1fe18d3598fcdf04b265d46c07d695c43504ea2fba9e74287766e
MD5 46474675469391e9653b5f6ce4e65065
BLAKE2b-256 09482cda7efa0153f0ca93f2dd0105c1157b125d562658fd3565a633089de25a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e43113f7fcd25c1de4ccb81658748e4b4edcea74b66b73ffb18d6d5d018ab623
MD5 193728653f0c4ebf1cd19911a15fce91
BLAKE2b-256 9a6ae950aeaf5f2e9c9f4561cd0bb2d14a3dd24b386ee649501d7819261c0264

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 8c345961090b2471d9d9c66fefee7084d4665189909a2d875f7279a3a68a09fb
MD5 ad711f886f73dd3832c4a7662b0ece84
BLAKE2b-256 de08f5d944f33aff8ed9dbd9d0fb23abf32f458c475a4ecf368e801cd871ed91

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d8bb97f027179638c1913b0a0cb59ce250fce8750c8588d971a160f1c70a3969
MD5 1c0d09e157654710e4a66ebeed4e5c34
BLAKE2b-256 b982f577c5310d364c610d3da659670df201a56b84769c76c95d4d8e4a998657

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 40c0aafde1c2dc3ae4227695017df436fc4fd693f63e897a4d14195d148da4a6
MD5 6323a49124ec2116b699489494aff784
BLAKE2b-256 4640e59c165637ceed36b169ed265fde364a5fd2b71733649997abe63ff228c0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 ace775ea2a77e73952039bd4defa5de909f47d7a3b8fd4e8281b5f266597bb71
MD5 f854eab12b9a4c7263aad619cde5e90f
BLAKE2b-256 1ff10691cee21546e2943de99d6e92c3dd866dcd2407ade9579e6d6a18320d28

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 e0edd52e64a100aa7e88c56099ff5754a2b3a61ea6e53148fe41866de0383dd1
MD5 450352821fd56b06f4d443d70b4568f4
BLAKE2b-256 35a70b6652c1384cb9477b618eec4367544ab77e3956964bcf1b7ffb6593369f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 55e7f4869fb720e6adf8ccb65867d0256f4fdad65152c05b0268bf4204636574
MD5 9d600f9be3f66b66aa4828eefb2e3c8f
BLAKE2b-256 490e7af1bbdcc6f39b36062706ca67cc54e1051a82a05e2f1dc88371bcf8ac50

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 36302cacb9cfcc5032e4f60df454c35e2bd214ef7e65070ccda8d17373b33012
MD5 17c45d977af1a2279c24a5619b704938
BLAKE2b-256 8b8b6702b635cf5cb529bd4d1432b8dac1e9569545aec324fdceba98d27fc753

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 7eab6bed7e26d4fbcba39ea828ebde417a9f24839dc0f9d4dab49e63e7c962bb
MD5 1ffd4bc662090d7c51a0db7fb7685c91
BLAKE2b-256 2a962090c45b514b891527b50c703342d1c88a8fb4ad6618f3186d4a8baa2412

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 9878cd8ad0b831b4126f027241f677a24f76c821780d449c35c81f5ad5273a3e
MD5 3d69fda3cbeb271c6bc8aaa763bff408
BLAKE2b-256 5e927fc1844cb74d4596f127a19a214d18eea83bb6a8e5918aa16e45609a89e8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 47a1d563305ba6317706b9ab47e53144d807c261ae7a861db624435b499d709f
MD5 b012bf3c9e7921001bb3bc858c1316a2
BLAKE2b-256 10a4068b51d78cc6b184d57383df85f224e382fb76e1f5c0d610a42d94aad39e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d32ca4a847e9e25c935fb187097ba4943ce52515688a85c8a745699db4991505
MD5 a5d3f18c841df2fbf152ea141367b07c
BLAKE2b-256 80921943236e4a0ba280cbc3ab9931515a3505adbbb8c3f1fcd695ddc5ded763

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-16.0.0-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f887f8c8ab6975e4cd6f414512277fcd7f3fe8a3d21292010164c4ae31654c91
MD5 f696878fcd772cff7ab9eabd08f13971
BLAKE2b-256 9eacbf3b20e318e959e7ca8229c61dc208c87704e47e288c842ee39f603880c6

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