Clang format download windows

Project description

clang-format Python distribution

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: v20.1.4
  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:

  • Edit the version file
    • In the form llvm_version.wheel_version, e.g. 18.0.2.1
  • Tag the commit with this version to trigger the GitHub Actions release workflow
    • e.g. git tag v18.0.2.1 && git push origin v18.0.2.1

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

Built Distributions

File details

Details for the file clang_format-20.1.4.tar.gz.

File metadata

  • Download URL:
    clang_format-20.1.4.tar.gz

  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4.tar.gz

Algorithm Hash digest
SHA256 4fb181078b1c3bc46657b98086cbc691dbe4f211dbce552cb296d02b791d8943
MD5 f4155ec34fd57950cfbf3e516f2e7652
BLAKE2b-256 6721b2e572e8032aa19434a5ebe7c337bc9bb6a1a115dac2b958e69f834644fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4.tar.gz:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4.tar.gz
    • Subject digest: 4fb181078b1c3bc46657b98086cbc691dbe4f211dbce552cb296d02b791d8943
    • Sigstore transparency entry: 207876395
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

Details for the file clang_format-20.1.4-py2.py3-none-win_arm64.whl.

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-win_arm64.whl

  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 2, Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-win_arm64.whl

Algorithm Hash digest
SHA256 236759b490bf82283a5a5725035384d776f5d23832af6f077508129c20117853
MD5 79732a14e22d48004921200edf6b0a34
BLAKE2b-256 6f55b0c66a826ed8a16ea09f5ca5bad270a0d3bbf8dff1bbdadbe264b898b1ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-win_arm64.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-win_arm64.whl
    • Subject digest: 236759b490bf82283a5a5725035384d776f5d23832af6f077508129c20117853
    • Sigstore transparency entry: 207876409
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

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

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-win_amd64.whl

  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 2, Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-win_amd64.whl

Algorithm Hash digest
SHA256 57a148289b31d8e9751c73e38de8a175d8d50ff4dd072491fab7207be952ba17
MD5 b095717a4691cbdf914829e8973df6e3
BLAKE2b-256 401b7c924d5c5855ce848476c8520bcb1631c6ed869e1df9030d615b460f7f26

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-win_amd64.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-win_amd64.whl
    • Subject digest: 57a148289b31d8e9751c73e38de8a175d8d50ff4dd072491fab7207be952ba17
    • Sigstore transparency entry: 207876407
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

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

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-win32.whl

  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 2, Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-win32.whl

Algorithm Hash digest
SHA256 808abb39b6ba72ace47d426b0c945a6915d69c6e71550d913e502960b821b968
MD5 c04a6cd44ee06a3fc64e443fd9255bc8
BLAKE2b-256 ee9e4f96dd2fe8de44e997991ca5f9a689c3209c3baab6270359152ba8e4548b

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-win32.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-win32.whl
    • Subject digest: 808abb39b6ba72ace47d426b0c945a6915d69c6e71550d913e502960b821b968
    • Sigstore transparency entry: 207876405
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

Details for the file clang_format-20.1.4-py2.py3-none-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-musllinux_1_2_x86_64.whl

  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 2, Python 3, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-musllinux_1_2_x86_64.whl

Algorithm Hash digest
SHA256 29e807be03fb84d7a61c305a356888c17af69a124b25fe0d3795b207447fc629
MD5 036c86e75fadee29fd1d8c1dbe55db2f
BLAKE2b-256 ed232902cf717dd3972ce8947d2328a87a009eaa98dd70321b354458d5289038

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-musllinux_1_2_x86_64.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-musllinux_1_2_x86_64.whl
    • Subject digest: 29e807be03fb84d7a61c305a356888c17af69a124b25fe0d3795b207447fc629
    • Sigstore transparency entry: 207876400
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

Details for the file clang_format-20.1.4-py2.py3-none-musllinux_1_2_s390x.whl.

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-musllinux_1_2_s390x.whl

  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 2, Python 3, musllinux: musl 1.2+ s390x
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-musllinux_1_2_s390x.whl

Algorithm Hash digest
SHA256 b76a43a8a348cc8f315e9369fcdb5627e6d4c4dfcb8d5452667bac0adcf10b0f
MD5 70cc74e21ec61ac248c5d63856e4c0e3
BLAKE2b-256 2d2041cd412334fb8ab821a85a89cb779c7eb3cfa0b6d3d64d6797edafb5c0f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-musllinux_1_2_s390x.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-musllinux_1_2_s390x.whl
    • Subject digest: b76a43a8a348cc8f315e9369fcdb5627e6d4c4dfcb8d5452667bac0adcf10b0f
    • Sigstore transparency entry: 207876423
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

Details for the file clang_format-20.1.4-py2.py3-none-musllinux_1_2_ppc64le.whl.

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-musllinux_1_2_ppc64le.whl

  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 2, Python 3, musllinux: musl 1.2+ ppc64le
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-musllinux_1_2_ppc64le.whl

Algorithm Hash digest
SHA256 f4b6cd9c948787aaa2b9204099fb9a018726b68959271f33761caa8bcb7d8062
MD5 6a276b181204feac21db65ba1cb707dc
BLAKE2b-256 848f1890ab2037d0624c218917d2417f190c6e88c7b9c90eac082573a92bb4d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-musllinux_1_2_ppc64le.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-musllinux_1_2_ppc64le.whl
    • Subject digest: f4b6cd9c948787aaa2b9204099fb9a018726b68959271f33761caa8bcb7d8062
    • Sigstore transparency entry: 207876427
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

Details for the file clang_format-20.1.4-py2.py3-none-musllinux_1_2_i686.whl.

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-musllinux_1_2_i686.whl

  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 2, Python 3, musllinux: musl 1.2+ i686
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-musllinux_1_2_i686.whl

Algorithm Hash digest
SHA256 747e55cc574ae63cef4d1b81e53f2e6702b13c70a224164fa56c367f1acf9db4
MD5 1d7ae1f6aa64466bf6f7ac4ad8f535b0
BLAKE2b-256 472543cf230a94af0fc8daf74f856754d2280b0cebd508ca6a31f2e672ee8da2

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-musllinux_1_2_i686.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-musllinux_1_2_i686.whl
    • Subject digest: 747e55cc574ae63cef4d1b81e53f2e6702b13c70a224164fa56c367f1acf9db4
    • Sigstore transparency entry: 207876418
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

Details for the file clang_format-20.1.4-py2.py3-none-musllinux_1_2_aarch64.whl.

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-musllinux_1_2_aarch64.whl

  • Upload date:
  • Size: 2.8 MB
  • Tags: Python 2, Python 3, musllinux: musl 1.2+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-musllinux_1_2_aarch64.whl

Algorithm Hash digest
SHA256 11cc2e994159fdc82f241ca63917f6c8c42b5495763d065a75b678456ded209a
MD5 ec3af8c389a7c807ca4e83edac05f669
BLAKE2b-256 86e46fd704d9169d065796e847b579f2ec350aac15ed618bde2664981c8f4e9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-musllinux_1_2_aarch64.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-musllinux_1_2_aarch64.whl
    • Subject digest: 11cc2e994159fdc82f241ca63917f6c8c42b5495763d065a75b678456ded209a
    • Sigstore transparency entry: 207876430
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

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

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Algorithm Hash digest
SHA256 29e4391cd0a4721178d45fb41404b79b8e39119eedfa574915d7568eb6ea5658
MD5 d253ea6712b0f655fc7758eb019231d3
BLAKE2b-256 b395e5011f1d6566a78570f7fbeece871edb75bf29bdf212729f2cada226c9ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
    • Subject digest: 29e4391cd0a4721178d45fb41404b79b8e39119eedfa574915d7568eb6ea5658
    • Sigstore transparency entry: 207876414
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

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

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl

  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.17+ s390x
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl

Algorithm Hash digest
SHA256 4bd766c8b73c742972d91f672188a9b00c93eb84d48e7415806e8ba1b2793c8d
MD5 fa1ba7dd61c52a3605d6ce2ad30aab20
BLAKE2b-256 5d2191fce83ddc210b920b62412ce8ecd8cc41fa6f6ee6a0e241a3a6e390f744

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-manylinux2014_s390x.manylinux_2_17_s390x.whl
    • Subject digest: 4bd766c8b73c742972d91f672188a9b00c93eb84d48e7415806e8ba1b2793c8d
    • Sigstore transparency entry: 207876397
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

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

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

  • Upload date:
  • Size: 2.7 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.17+ ppc64le
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Algorithm Hash digest
SHA256 47221a8cdee0197df320a2e801bc4b6991d91401f85783248b54975cd4d13f21
MD5 184fad93f50ac18d79e42223af619250
BLAKE2b-256 a0f7299cee6a94943f05404dfafad7feaee7936b93cf91646f5b2f4461c98f21

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl
    • Subject digest: 47221a8cdee0197df320a2e801bc4b6991d91401f85783248b54975cd4d13f21
    • Sigstore transparency entry: 207876421
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

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

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl

  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.17+ i686
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl

Algorithm Hash digest
SHA256 f0cb3384ae2a6bbdda7bcf381f4e677b8ff854f4991292ac54b50a88542a2edb
MD5 940137e351f6467977203c4879ab234f
BLAKE2b-256 c201262b811ae3e2fc3c4b66f4e1d3e3f3399efc328f45a9e3755767e94e8243

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-manylinux2014_i686.manylinux_2_17_i686.whl
    • Subject digest: f0cb3384ae2a6bbdda7bcf381f4e677b8ff854f4991292ac54b50a88542a2edb
    • Sigstore transparency entry: 207876425
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

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

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Algorithm Hash digest
SHA256 ec00d2d2ac5150a54ec6cd53dfd9d4210414e0fd92c069f75b09b7d8655007cd
MD5 3f3e0f6a1b9c492bf319f63c8c7b1011
BLAKE2b-256 e639a899fc5964e51047936ec9bca8b3dee25d9a50e5826926297331368fef51

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
    • Subject digest: ec00d2d2ac5150a54ec6cd53dfd9d4210414e0fd92c069f75b09b7d8655007cd
    • Sigstore transparency entry: 207876404
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

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

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-macosx_11_0_arm64.whl

  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 2, Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-macosx_11_0_arm64.whl

Algorithm Hash digest
SHA256 16d579183117b5c67e353aad8981d6b7cff5d150f183e53e7a388aae0fed6986
MD5 e155bd7a669d8e9fd8288f1891285f76
BLAKE2b-256 67d30ab81a89206d51077ce890e95253d97753be776ca1077c6c5a7c783a5ba0

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-macosx_11_0_arm64.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-macosx_11_0_arm64.whl
    • Subject digest: 16d579183117b5c67e353aad8981d6b7cff5d150f183e53e7a388aae0fed6986
    • Sigstore transparency entry: 207876402
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

File details

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

File metadata

  • Download URL:
    clang_format-20.1.4-py2.py3-none-macosx_10_9_x86_64.whl

  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 2, Python 3, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for clang_format-20.1.4-py2.py3-none-macosx_10_9_x86_64.whl

Algorithm Hash digest
SHA256 30d8f8d56adc04a9cefa84e1d0883514cdff4a3d7acb123141ce4b3a5108a2bb
MD5 1d316edec0a61d7c7916cf1333ad3731
BLAKE2b-256 006628a279ee685f04683dbca3d5b731eb38cb1df699e4a80a083c59325ae5fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_format-20.1.4-py2.py3-none-macosx_10_9_x86_64.whl:

Publisher:

release.yml on ssciwr/clang-format-wheel

Attestations:

Values shown here reflect the state when the release was signed and may no longer be current.

  • Statement:

    • Statement type: https://in-toto.io/Statement/v1
    • Predicate type: https://docs.pypi.org/attestations/publish/v1
    • Subject name: clang_format-20.1.4-py2.py3-none-macosx_10_9_x86_64.whl
    • Subject digest: 30d8f8d56adc04a9cefa84e1d0883514cdff4a3d7acb123141ce4b3a5108a2bb
    • Sigstore transparency entry: 207876415
    • Sigstore integration time:

    Source repository:

    • Permalink:
      ssciwr/clang-format-wheel@0ce6979744c2da703731aaa76a8c7cfcf13a633c
    • Branch / Tag:
      refs/tags/v20.1.4
    • Owner: https://github.com/ssciwr
    • Access: public

    Publication detail:

    • Token Issuer: https://token.actions.githubusercontent.com
    • Runner Environment: github-hosted
    • Publication workflow:

      release.yml@0ce6979744c2da703731aaa76a8c7cfcf13a633c

    • Trigger Event: push

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

A tool to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C# code.

Command Line

Download Links For Version 19.1.0

Download Links For Version 19.1.7

Download Links For Version 18.1.6

Info


  • last updated 2/21/2025 12:00:00 AM

  • Publisher:
    LLVM

  • License:
    MIT

Dependencies

No dependency information

Share

Just as Black and isort can be used to format Python code, clang-format can be used to format C/C++/C# code (and more1).

Quick start §

  • Install clang-format.
  • Run clang-format -i <file> to format a single file in-place.
    • If you omit -i, the output is printed to stdout.
  • Use --style=<string> to choose from a predefined style.
    • Options are: LLVM, GNU, Google, Chromium, Microsoft, Mozilla, Webkit.
    • Preview styles here in your browser.
  • Or, define your own style in a .clang-format file.
    • Use --style=file to load a style from a .clang-format file.
      • Note that clang-format will search for a file with the exact name .clang-format in the current working directory, and if it does not find one, will go up one directoy (..), and repeat.
        • To avoid this search behaviour, and instead explicitly specify the file, use --style=file:<file path>.
    • Generate a .clang-format populated with a predefined style with: clang-format --style=Chromium --dump-config > .clang-format.
      • This will contain every single rule.
      • Alternatively, you may write your own .clang-format and only specify the rules you need.

Formatting multiple files (Bash, Linux) §

Commonly you want to format multiple source files.

Using clang-format -i *.c will only find *.c files in the current directory.

To format *.c and *.h files recursively, you can use find:

clang-format -i --style=file $(find app src include | grep -E ".*(\.c|\.h)$")

To skip any files with third_party in the filename:

clang-format -i --style=file $(find app src include | grep -E ".*(\.c|\.h)$" | grep --invert-match "third_party")

Formatting multiple files (Windows, PowerShell) §

Likewise, to run clang-format on all matching source files recursively using PowerShell, while filtering out files with third_party in the filename:

clang-format -i --style=file $(Get-ChildItem -Path $PWD/app,$PWD/src,$PWD/include -Recurse | Where Name -Match '\.(?:h|c)$' | Where FullName -NotMatch 'third_party' | Select-Object -ExpandProperty FullName)

Default style §

The default style for clang-format is LLVM. This fact is buried deep within the docs2, inside the description for RawStringFormats:

If BasedOnStyle is not found, the formatting is based on LLVM style.

This is further confirmed by this line within clang/lib/Format/Format.cpp:

const char *DefaultFallbackStyle = "LLVM";

Sorting includes §

The styles LLVM and Chromium will sort includes by default, but the other styles will not.

Sorting includes is enabled by setting SortIncludes to CaseSensitive or CaseInsensitive (see the docs for the difference). It is disabled with Never.

Beware that naïvely sorting includes can have unintended side-effects, but using IncludeCategories gives you control over how the includes are ordered. So if the include order matters, as long as you correctly configure IncludeCategories, you can still enable SortIncludes.

Beware that, when sorting includes, the whitespace between #include lines is potentially significant, for two reasons:

  • The IncludeBlocks option configures how clang-format handles whitespace between otherwise consecutive lines of #includes.
  • If #includes are separated by something else (e.g. an #ifdef) then clang-format will handle each block of includes separately. (Or perhaps it just does the first block? TBC).

There is special handling for the main #include for a source file (e.g. the main #include for "foo/widget.c" is "foo/widget.h"):

  • clang-format will attempt to find the main include for the file.
  • The regex defined by IncludeIsMainRegex is used to determine whether an #include is main, and if so, it is given priority 0 (i.e. highest, go to the top).
    • For the LLVM style, this defaults to (Test)?$, which would permit the main include for both "Widget.c" and "WidgetTest.c" to be "Widget.h".
    • For the Google style, this defaults to ([-_](test|unittest))?$, which would permit the main include for "widget-test.c, "widget_test.c", "widget-unittest.c» and "widget_unittest.c" to be "widget.h".
  • All #includes are considered for being the main include. The deciding function strips off the surrounding "" or <> from the include, and then checks that matches the filename. If a match is found, it is then put through the regex defined in IncludeIsMainRegex. If that passes, only then is it considered a main include.
    • See the implementation for more details.

Install clang-format §

Install clang-format on Windows §

Go to the LLVM releases page and download the Windows LLVM installer.

For example, at time of writing v18.1.8 is the latest release. The download named clang+llvm-18.1.8-x86_64-pc-windows-msvc.tar.xz includes LLVM and clang (and clang-format).

Install clang-format on Debian/Ubuntu §

It’s as easy as:

sudo apt install clang-format

Example .clang-format §

Following is an example of a hand-written .clang-format. It’s written in YAML:

---
BasedOnStyle: LLVM

# Alignment.
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true

# Allow one-liners for case labels.
AllowShortCaseLabelsOnASingleLine: true

# Indentation.
IndentWidth: 4
ContinuationIndentWidth: 4
UseTab: Never

# Always list each argument on its own line.
BinPackArguments: false
BinPackParameters: false
ExperimentalAutoDetectBinPacking: false
AllowAllParametersOfDeclarationOnNextLine: false

# Spaces.
SpaceAfterCStyleCast: false
SpaceBeforeParens: ControlStatements
SpacesBeforeTrailingComments: 2
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInSquareBrackets: false

# Breaks.
BreakBeforeBraces: Mozilla
BreakBeforeBinaryOperators: NonAssignment

# Sorting includes.
# * The main header gets priority 0, and goes at the top. The main header is
#   essentally any header file which corresponds to the current source file
#   (e.g "foo.h" is the main header for "foo.c"). However, only header files
#   that match the regex in `IncludeIsMainRegex` are considered.
# * The "log/mod/blah.h" headers get priority 1.
# * The "blah.h" headers get priority 2.
# * The <blah.h> headers get priority 3.
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
IncludeIsMainRegex: '$?'
IncludeCategories:
  - Regex: '^"log/mod/.*"'
    Priority: 1
  - Regex: '^".*"'
    Priority: 2
  - Regex: '^<.*>'
    Priority: 3

# Misc.
IndentCaseLabels: true
ReflowComments: true

For a guide as to what each rule means, try this tool, and click the blue information icon next to the rule in question.

README

Clang-Format is a tool to format many different coding languages. It can be configured with a config file named .clang-format within the working folder or a parent folder. Configuration see: http://clang.llvm.org/docs/ClangFormatStyleOptions.html

This project is a fork of the older vscode-clang-format extension, but has been rewritten with modern VSIX and TypeScript best practices. I believe that I have integrated all outstanding feature requests as well.

Usage

This extension allows clang-format to be used to format C/C++, Javascript etc.
source files directly from within Visual Studio Code 1.96+. Note that this
extension is not needed if you are running the full clangd LSP extension —
it is only made available here for people who want to use clang-format without
all the other features clangd provides.

Files can be formatted on-demand by right clicking in the document and
selecting «Format Document», or by using the associated keyboard shortcut
(usually Ctrl+⇧+F on Windows, Ctrl+⇧+I on Linux, and ⇧+⌥+F on macOS).

To automatically format a file on save, add the following to your
vscode settings.json file:

{
    "editor.formatOnSave": true
}

Specifying the location of clang-format

This extension will attempt to find clang-format on your PATH.
Alternatively, the clang-format executable can be specified in your vscode
settings.json file:

{
    "clang-format.executable": "/absolute/path/to/clang-format"
}

Placeholders can also be used in the clang-format.executable value.
The following placeholders are supported:

  • ${workspaceRoot} — replaced by the absolute path of the current vscode
    workspace root.
  • ${workspaceFolder} — replaced by the absolute path of the current vscode
    workspace. In case of outside-workspace files ${workspaceFolder} expands
    to the absolute path of the first available workspace.
  • ${cwd} — replaced by the current working directory of vscode.
  • ${env.VAR} — replaced by the environment variable $VAR, e.g. ${env.HOME}
    will be replaced by $HOME, your home directory.

Some examples:

  • ${workspaceRoot}/node_modules/.bin/clang-format — specifies the version of
    clang that has been added to your workspace by npm install clang-format.
  • ${env.HOME}/tools/clang38/clang-format — use a specific clang format version
    under your home directory.

Placeholders are also supported in clang-format.assumeFilename. The supported
placeholders are ${file}, ${fileNoExtension}, ${fileBasename},
${fileBasenameNoExtension}, and ${fileExtname}, with the same meaning as the
predefined variables in other configuration files.

For example:

  • ${fileNoExtension}.cpp/home/src/foo.h will be formatted with
    -assume-filename /home/src/foo.cpp.

The same placeholders are also supported for clang-format.style and clang-format.language.<language name>.style.

Installing Clang-Format

On Linux, install clang-format from your distro’s package manager.

On MacOS, the simplest way is to use Homebrew and run brew install clang-format.

On Windows, the simplest way is to install LLVM to the default path either using the installer or by simply running winget install -e --id LLVM.LLVM using winget.

LLVM contains the clang-format binary, the resulting path for the clang-format.executable then becomes:

{
    "clang-format.executable": "c:\\Program Files\\LLVM\\bin\\clang-format.exe"
}

Source code

Available on github: https://github.com/a5ehren/vscode-clang-format

Update Policy

I consider this extension to be fully feature complete. Releases will be made roughly quarterly if the GitHub dependabot finds changes to be made or there are non-critical issues I can resolve. Security fixes will be released as-needed as quickly as possible.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Проброс видеокарты в hyper v windows 10
  • Windows server 2019 создать raid 1
  • Слетел windows boot manager
  • Как пользоваться aircrack ng для windows 10
  • Windows 10 build 10056