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

Uploaded Source

Built Distributions

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

Uploaded Python 2 Python 3 Windows x86-64

clang_format-14.0.6-py2.py3-none-win32.whl (833.5 kB view details)

Uploaded Python 2 Python 3 Windows x86

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

File metadata

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

File hashes

Hashes for clang-format-14.0.6.tar.gz
Algorithm Hash digest
SHA256 d5c96b500d7f8b5d2db5b75ac035be387512850ad589cdc3019666b861382136
MD5 de6a0b2c7291060eedf5b939ab7a296e
BLAKE2b-256 0c92d57c1b3ea310ae0f48ab51a5aa2c87c4c732c3d79037ad2527f2eed7ca34

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.6-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d780c04334bca80f2b60d25bf53c37bd0618520ee295a7888a11f25bde114ac4
MD5 988c9a4277fd6df5e23b227f5b904b3b
BLAKE2b-256 637a1f11404d5097263ad065cf9166dd00be0a8c1040c1ec4f57921ac07591eb

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.6-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 810c649ab97d208cd418c897d50ab6e958eb8d96854527edd80d0dd21a75e914
MD5 4790ecad07a0649cf8548bf24a993b75
BLAKE2b-256 6e06302903004246dd62a11965e9f672b975c58ad6966985dbcaa14c6cdb4779

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.6-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 aaf4edecc46a24f0b572b82cf5827e292ad1c137903427627c4d5f671668cc2b
MD5 9b320f689ee59caadc416b036f13923e
BLAKE2b-256 cd3b3e20072464e98314eafdc5bc5744454ade6e6f5e525fb29f6b4555173811

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.6-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 c93580945f75de7e01996f1fb3cf67e4dc424f1c864e237c85614fb99a48c7a4
MD5 2fa31ce1aa675e52ad90ee7f05729051
BLAKE2b-256 8c67e1faf73ea166669e1698f55f3ae366369db57d75eb3b6c04c93620ebac12

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.6-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dbfd60528eb3bb7d7cfe8576faa70845fbf93601f815ef75163d36606e87f388
MD5 98e1e2333bec30c77f90212578fca178
BLAKE2b-256 23e4ea55429601432913e9fe40686c3c09a79338075c830a523fabc71aa49c69

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.6-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d7c1c5e404c58e55f0170f01b3c5611dce6c119e62b5d1020347e0ad97d5a047
MD5 3167e55cceab97066597438007df0572
BLAKE2b-256 ce27df41404419d9116e071d0b8a5ba0a0969d9db7587af689ec81ec75c1f18a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.6-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 13f2d6d4a2af004a783c65f0921afa8f0384bffcdaf500b6c2cb542edeb0b4a5
MD5 226f8b09231eeb975591070929974a95
BLAKE2b-256 5fdef666633c30a4cc9e987d153db992849bfeea03ad200bf1cfa937039c64ff

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for clang_format-14.0.6-py2.py3-none-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bd400c47665dd19afc03f98e747f78ed828abab99c6a1b07e137b35c1cd3cc26
MD5 d3f7c6e9b87ea6cd293efcdd9f4026a5
BLAKE2b-256 086271ffc9213f66cab7dd5adc5e933b5f64323272c197fcff2905674016c03d

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