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.5
  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


Release history Release notifications | RSS feed

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2Python 3Windows x86-64

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

Uploaded Python 2Python 3Windows x86

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

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

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

Uploaded Python 2Python 3musllinux: musl 1.1+ s390x

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

Uploaded Python 2Python 3musllinux: musl 1.1+ ppc64le

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

Uploaded Python 2Python 3musllinux: musl 1.1+ i686

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

Uploaded Python 2Python 3musllinux: musl 1.1+ ARM64

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

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

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

Uploaded Python 2Python 3manylinux: glibc 2.17+ s390x

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

Uploaded Python 2Python 3manylinux: glibc 2.17+ ppc64le

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

Uploaded Python 2Python 3manylinux: glibc 2.17+ i686

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

Uploaded Python 2Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 2Python 3macOS 11.0+ ARM64

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

Uploaded Python 2Python 3macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: clang-format-17.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 8fc4ef6ad1b6ad11f5903069f34a661699bb187288c09f643990a42ee41df47e
MD5 fc4991283224e5e247358397aca67a71
BLAKE2b-256 8b4dec08df9d0d2aae095166c62962548a748758771a14f9cee5e0c3e5d977c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 94d7024db3b6525ceb498d6dbd6fcb2cac7c7a2820b629097651b9dbb2f4e322
MD5 dc683667cd21685330d77aabe5512de9
BLAKE2b-256 8f532e3d3f58b428f2aa6b39ae74d37818f8980b62c9efe2432376d596d752f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clang_format-17.0.5-py2.py3-none-win32.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 2, Python 3, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 c86ac588d655c06721ae0943685be9349654793b6c47c341f35182037153f2b5
MD5 96878d3258c5260afd464e5fe20d7dbb
BLAKE2b-256 52553b1708b7a1082af4fe2e025521856e315f56f17cd75cb3b4027e4a83daf5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 f52c88360af2303d0225d9974328e5f4c0318f47a112513ccc246d4f908d8962
MD5 5fe0c7655d3f3a52ba79a72e5e59d8c9
BLAKE2b-256 f25c00dc4aeef5ea0666bf83fa1d6df72898ab2ab6134376565ec30fabf76384

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-musllinux_1_1_s390x.whl
Algorithm Hash digest
SHA256 ce67bcd3a5431cb40e4eb67319fa1f39adab02b80b104a748723084a584e9afe
MD5 55e6c27960ce7648820b089576469cce
BLAKE2b-256 6e4817f96729e858c12c2acc9b5e6097e70a22db62991d355f694483e608c004

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-musllinux_1_1_ppc64le.whl
Algorithm Hash digest
SHA256 b742a88301da19f50b87ccf0aab441b228007513d58f1ee77aaf616c07c97f81
MD5 2d8f12793c431a102f34c523c28d3975
BLAKE2b-256 d6aad17684289305d40f1afc720050fd08623a21eeb02ca2e880aa00fcbe0ddd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 95be9e9a823dd57afe4fa61ca7ff9c459058346bab26d92ebdd20cf67bd4aa5d
MD5 5c5177ffec578bedb9ba1661c0ce2d52
BLAKE2b-256 86a16f43fa73851c99136fd7587f3dbf9ac37ec8b1aec994c8c150b289e9c946

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 54a518e91316068dc5b18e9f60969791962be054b12c8461935a9f11ad8c7331
MD5 cb79af0c6e70bc89446fc261644a084c
BLAKE2b-256 fa40b887839b0af21c13a880347bbcf99a8f76cc3202d329b0ab54bf6897d19f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90c602ff2122ffb6b21d54608a622834720d21ed0193669a4e248936a1e35e2a
MD5 fcb43d567b11c453a2cd89e16ce2b82f
BLAKE2b-256 e71a33ff3eef383ee7cda6ee38aa155185349ad0cd85299655b69b393241d10f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 b7c43c6941995430f21d6c4aa9bd31e09e74b0a073328c89f9c58b8f18367415
MD5 a34a0e910dfb2fd0a57280f446da6d72
BLAKE2b-256 27f482dfe457697ac43561a541ce1fddc62f5bd7405772c27d6642380b9cabc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 efddce875e753b65ebd0309b50c02f1195ef6bba1556aff726db25df6fb4c5e2
MD5 a841ff2bc33ccf6f0ca8db24306b9cd3
BLAKE2b-256 ba5998d64a3fcc5ee7866e97bdf3561a631b19adad5b2b09e3e6a959b51feab9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 50a722142b7139da6584ef58ce12212842711c12fe829cf82391143cb9b7fe8c
MD5 ad67b51b76df9ffb3ac2b5f2a6da28fc
BLAKE2b-256 09d8e39d3970f4aa8545d47bbe38e17f2df71aad2d24b9cebe2cc9b7665258b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 85378a9f8f2a1cbb29f66b2229f47030fbedda452379bf49de3a10ef0d584949
MD5 4162fbbd8e6684b40bbfb5d98a54d1bf
BLAKE2b-256 b3f75f0fe9e60c1016ca089c85b924d6f2f6940f4ca40d6e06a6f05f0783acea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03d56cef8205646d61077b62cb571e9fb608d6f144499624b43545576f240de6
MD5 d1326ae48a7de4e2bfd9dff6dcc7e0ac
BLAKE2b-256 8b5ca8b845f672cbdf24c5507283934f11e7516d30ffa6ac9ea3e8212449ee90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clang_format-17.0.5-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c18f71185f730a66d6be78938a21644f501a26d0d051ae61c9587146c5a0bd1c
MD5 4935b7c5ab6803e81b4ef58f6e9ec493
BLAKE2b-256 612eea1c944f3d00b27ae6b5fb31427998c9001d0e0c0eab52947dea49f7349f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page