Skip to main content

Clang-Format is an LLVM-based code formatting tool

Project description

pmi-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 pmi-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: v18.1.8
  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

pmi_clang_format-19.1.0.2.tar.gz (19.6 kB view details)

Uploaded Source

Built Distributions

pmi_clang_format-19.1.0.2-py2.py3-none-win_amd64.whl (1.4 MB view details)

Uploaded Python 2 Python 3 Windows x86-64

pmi_clang_format-19.1.0.2-py2.py3-none-win32.whl (1.2 MB view details)

Uploaded Python 2 Python 3 Windows x86

pmi_clang_format-19.1.0.2-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

pmi_clang_format-19.1.0.2-py2.py3-none-musllinux_1_2_i686.whl (3.0 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.2+ i686

pmi_clang_format-19.1.0.2-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

pmi_clang_format-19.1.0.2-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

pmi_clang_format-19.1.0.2-py2.py3-none-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded Python 2 Python 3 macOS 11.0+ ARM64

pmi_clang_format-19.1.0.2-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 pmi_clang_format-19.1.0.2.tar.gz.

File metadata

  • Download URL: pmi_clang_format-19.1.0.2.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.6

File hashes

Hashes for pmi_clang_format-19.1.0.2.tar.gz
Algorithm Hash digest
SHA256 c8d05ccd0f4df37c0715fdab0d440fe49e5d704f51a0680927ab56cd2b05835d
MD5 2990a7a51180b4c3edd1d058f3217d64
BLAKE2b-256 2c544295953e3794e38161b7878df396e9170a4dbfd17279832e2de1a748e28c

See more details on using hashes here.

File details

Details for the file pmi_clang_format-19.1.0.2-py2.py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for pmi_clang_format-19.1.0.2-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cad5bb56031618b08008ad41120beceb1e0e96065830aaba0331cce4c44750fb
MD5 fe99610199759b132138b8c2c433309f
BLAKE2b-256 68d8cabf11c8540048a24b229c76b6b2e94088575e45795ad8dc7482c64d7ecf

See more details on using hashes here.

File details

Details for the file pmi_clang_format-19.1.0.2-py2.py3-none-win32.whl.

File metadata

File hashes

Hashes for pmi_clang_format-19.1.0.2-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 6054fe36b7afc5da8874916a2381c83cb3fab2739fd2af7ad13465e9a0422d4a
MD5 45e4387c55608d120afdeb5be3cf4c1d
BLAKE2b-256 a15da03fd6dc62255a1113b40d038a688d481246d1c9304d3baf97cb27b4a8f6

See more details on using hashes here.

File details

Details for the file pmi_clang_format-19.1.0.2-py2.py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pmi_clang_format-19.1.0.2-py2.py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ead23ee90de382e409de8b13d25d451ec0a3c72693db8cabc8b4385bfe817720
MD5 a4574a0524b58f665370e48243782608
BLAKE2b-256 f83f2202409388e9d5a3ae7bbac270763291ec9df44dee22a6000f36cb79712d

See more details on using hashes here.

File details

Details for the file pmi_clang_format-19.1.0.2-py2.py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for pmi_clang_format-19.1.0.2-py2.py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 cc2628756fb31a71091237a03d344448e3fd7ce465878667ebaedcb764fd3278
MD5 c94838b40bfc04bb9ea611b2e835df04
BLAKE2b-256 21969a3899b03b56a5f4dcd88f7c9befb561d7594d403a7760f672d303a3676b

See more details on using hashes here.

File details

Details for the file pmi_clang_format-19.1.0.2-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pmi_clang_format-19.1.0.2-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3010d9130f428f57d8a4a9dddaf6a1445ff26579c1688ab116d373cf1044104a
MD5 53d3743a790d9e2316c87d4f504b545a
BLAKE2b-256 607af8f9fe843a18e02c46177b8093a06bb0295e683ec66fedfb7b933a46bce7

See more details on using hashes here.

File details

Details for the file pmi_clang_format-19.1.0.2-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pmi_clang_format-19.1.0.2-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 35bfd2baa29bbbcef17442c9b5de301f6e5dbe4e14b4ab5768e3dc97595ee9e1
MD5 1bbedd6c6bbb61de4607b9c88c1f6d7c
BLAKE2b-256 f01787a25e083fb62f067359704709861f4fe459ea3edc803e8210de36c92a6e

See more details on using hashes here.

File details

Details for the file pmi_clang_format-19.1.0.2-py2.py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pmi_clang_format-19.1.0.2-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e63cbb20e988cc93260c08cb3a608e524d6dbec3f2667c7c6775cb4966c92b33
MD5 281f540c9d2ce1b3ab5dc3520b59f654
BLAKE2b-256 9b7e05ef21518d530799838242a22462b7e0196ffa96f89f16eff0abe7ac37c0

See more details on using hashes here.

File details

Details for the file pmi_clang_format-19.1.0.2-py2.py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pmi_clang_format-19.1.0.2-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 19f6fedc33ab0f22e01323db79c4fc6694ffcea274bc28946eeb5661167bd727
MD5 bc42c09e5c061dda7e27d9804add95d9
BLAKE2b-256 cea0889fbd196223266fc03a7147431ea421b51d95d4a13f8a0d135cfa22854a

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