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

Uploaded Source

Built Distributions

clang_format-13.0.1.1-py2.py3-none-win_amd64.whl (839.9 kB view details)

Uploaded Python 2 Python 3 Windows x86-64

clang_format-13.0.1.1-py2.py3-none-win32.whl (671.4 kB view details)

Uploaded Python 2 Python 3 Windows x86

clang_format-13.0.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (983.6 kB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ s390x

clang_format-13.0.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.0 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ppc64le

clang_format-13.0.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.0 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ ARM64

clang_format-13.0.1.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (961.0 kB view details)

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

clang_format-13.0.1.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl (1.1 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.12+ i686

clang_format-13.0.1.1-py2.py3-none-macosx_10_9_universal2.whl (832.4 kB view details)

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

File details

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

File metadata

  • Download URL: clang-format-13.0.1.1.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-13.0.1.1.tar.gz
Algorithm Hash digest
SHA256 ccd9a570bfa1cd1d4a7eb30ea8736ff7f13b6ec234e671dbdf3ecd9eb3a736bf
MD5 72f919624704c819f78f7a9d82180623
BLAKE2b-256 8e08477d56adc2705cadf4558407cb3204bfc5b91bf37d5022f01d77d6c593b9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-13.0.1.1-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 518bd30dd61b1955849cd14694732323d7095bac9ac075d464bd50797fe91160
MD5 2de8c35e1cb23f4af23bf9127e558a85
BLAKE2b-256 c0368cee9d1bdf9fa956c125d62780018a18a5c87f33dc4ea7c3c8937e45b3dd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-13.0.1.1-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 e23a7c1f5140cbb380465e9f8d1d98618e0a34f4a714dcc2891b9414bffeccd1
MD5 e02d69c829249e277ffde6b4ba34d03a
BLAKE2b-256 d05563036d541aea733cfa2d982a771e7fe723fefa63de21fc992493c0a27500

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-13.0.1.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 7c462633ec19bedd837869d558be6a1e9049f27fee64b5431c9ef395f0dce15f
MD5 c3640bc1bf04fe96d9d2a89139ce83c9
BLAKE2b-256 92b66e2c92cb39b39ff01053c858500b911009099a2ec0bddfaa43c169a6fbd8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-13.0.1.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 28849832084e05b2d77fbd0aa43bbffb2c2e0d528016043e567a0797aa469104
MD5 0e5a42994486237d091b1a939be822e2
BLAKE2b-256 7ab7a2f43e92e8363db43d660fb96b6bf332b5a218bf2f0f068a43618a583ab4

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-13.0.1.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3f2aadcecad526ac98a02aee6fb09e4b481411b72afccbc5a4398e1132ee1254
MD5 4698aa805bd43b62fa8b3621b34d5f0e
BLAKE2b-256 6f23929d6590f9263e06c514ee0c1848532163158517030cf4e2c5fc1b1d55da

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-13.0.1.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 dba53a90c5356274c51f3ce642eee663a1e7d7b921233dadfa5001144aa5bd4b
MD5 bc7e90e6c41df06e8aca813f517a0336
BLAKE2b-256 2cfcd8b5554336f2a895f1ecfac32ba68ef9dc81d976a3c17a7ce12702dc7b04

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-13.0.1.1-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 d68891549557f9c47e555e756ffba698dc8edd44be6fdcd2f4d24f560da3894e
MD5 5448e10e5edcf25faa1e77a3c82a36ea
BLAKE2b-256 64d5402bb4ef9cd65b09386c9277d8dbc1eec1028810b225db327ce584e5eefe

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-13.0.1.1-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fb5f41196732d61c6d8ce81a4bb7e5196e70cc4168ec90c27ddd13188f0e47ce
MD5 c7febd9b0cc58fa47d3a91a6a23aa493
BLAKE2b-256 2d058ad829f01bd168e11f2552580bccf4ba0ba0e75e5268adf178dd7f3769e7

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