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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

clang_format-14.0.3-py2.py3-none-win32.whl (833.7 kB view details)

Uploaded Python 2 Python 3 Windows x86

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

File metadata

  • Download URL: clang-format-14.0.3.tar.gz
  • Upload date:
  • Size: 9.6 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.3.tar.gz
Algorithm Hash digest
SHA256 73bc0bd21eacdee30b85e1315a6cff5685531d89905c3411de91816fc7cbce75
MD5 9dcd4e8ea299c63e9bf760ea70c12933
BLAKE2b-256 9119b484a5df518e83fdf45482ce2396392932c5636c4a785b5d9c57d965b305

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.3-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a084aa5a8b56b07893014790c8b051e795977b24980fda3af5eb193539a9653c
MD5 95525644edb2a9c97dd0e8bfb65c887d
BLAKE2b-256 aa3f00a6ca37de9a08b0d6717910c8479ade1aa5cb33d0a0897d1236447c2d36

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.3-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 ae9746b024d900b3f2a5181fc9b1412a92a5df003793222cf9b646f21cb6f9eb
MD5 15bac3ef35905fa03a627242da17d818
BLAKE2b-256 6e889b6497ed42b6b7ce06fb6da65f31f63ce87ccaa97d2acd2c6f31d63777ec

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.3-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 00afee65c015d4c017d5b56524fc4a59829e5986ac159f0ab2c2147540a2b31a
MD5 7024cfd65b5200790282dc951d67b7c5
BLAKE2b-256 6556eb18d61a085ba018395155a2d658e0ee3aff0821a0b16d3d431b5ecec83b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.3-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 0925179fa10c444a07bdff5db6981868d07f109f1d8b5e5eaecc4f3b028e48a1
MD5 1ba424d25242809f40cfb130dab912d9
BLAKE2b-256 b1421a523349b0ae0ebcedb6278fade1fa5e0b303f9a18a480a342e4242d30bc

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.3-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b15a04d5c6ca463104518c461ef203f62f2a0b639d4e49d1362e2344ce25ec89
MD5 8d26295d33e9a3b95c53371ef04cc1f8
BLAKE2b-256 669152e3e26b31945dd2e58f0cdbd0697f424cb4bbd9ad254a3f800a3d3d2993

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.3-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 778e4acc74e1dcbd8197dcf49142b4102242a83881fb117b86727c01e74c6941
MD5 982bd8f011a79b253cd7dc77a50a0e07
BLAKE2b-256 a34d866c1f4bafd8ab2b957c7713aa2ae4db1363f781fb02fdd77ff531813abf

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.3-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 7dce28e40f2af48b1d0d5a0211562e592395d32c58483c0cafd75e7cf3297b55
MD5 afcdd759d93bedfbd684b2271857314b
BLAKE2b-256 4f9ebe1a223599b501a116048fdb5ed3e96fee68ae5afcac4608f885b04265f5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.3-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2c7da4ff143146fe7b80894efd32842f45d58a3bd30e8fb559ce86b961700a3c
MD5 0e698b67be36551690a8070bdc66a379
BLAKE2b-256 2fa701eebdafa44ca579383eb088dd6aa2179aa8c0bd661db17a6e52a5c5032b

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