--- id: clang-format version: "22.1.8" license: Apache 2.0 license_treatment: permissive maintenance: active --- # clang-format — Clang-Format is an LLVM-based code formatting tool License: permissive · Maintenance: active · Downloads: 4.3M/mo ## What it is and what it does clang-format is a Python distribution of the LLVM clang-format utility, which automatically formats C, C++, and CUDA code according to a style guide. Instead of downloading and installing clang-format separately from your system package manager, you can install it directly from PyPI as a Python package, making it easier to pin a specific version and use in CI/CD pipelines or development workflows. The package provides pre-built binaries for many platforms (Linux on x86_64, ARM, ppc64le, s390x; macOS on Intel and Apple Silicon; Windows on x86 and ARM64). It integrates well with pre-commit hooks and can be run via pipx for one-off invocations without a full installation. The versioning of the package matches the underlying clang-format release, so version 22.1.8 corresponds to LLVM clang-format 22.1.8. Use it for: - Enforce consistent C/C++ code style in CI/CD pipelines by installing a pinned clang-format version without system dependencies - Use as a pre-commit hook to automatically format staged C++ files before commit - Run clang-format on demand via pipx in GitHub Actions or other CI runners without pre-installation steps - Distribute a development environment where all team members use the same clang-format version regardless of OS ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Packages the clang-format code formatter as a Python-installable tool, making it available via pip without requiring separate system installation. Yes, if you need clang-format in a Python environment or CI pipeline. The package is actively maintained, has no runtime dependencies, carries a permissive license, and offers broad platform support. Install friction is moderate due to platform-specific wheels, but that is expected and handled transparently by pip. No known vulnerabilities. ## Install pip install clang-format uv add clang-format poetry add clang-format ## Installing clang-format Before you install: Medium install friction due to platform-specific binary wheels for multiple architectures (x86_64, ARM, ppc64le, s390x, and others across Linux, macOS, Windows). Package is actively maintained with a release 34 days ago and no runtime dependencies to manage. License in practice: Licensed under Apache 2.0 with LLVM exceptions (permissive). Safe for commercial and private use; you may use, modify, and distribute it freely provided you include the license notice. Quickstart: pip install clang-format python -m clang_format --help # Or use with pipx: pipx run clang-format --help Verify before relying: - Exact Python version compatibility (requires_python is unspecified in metadata) - Whether the package works on Python 2 despite py2 wheel names (modern clang-format may require Python 3) - Performance characteristics and formatting rule customization options ## Package facts - License: Apache 2.0 (permissive) - Python support: unspecified - Install friction: medium - Maintenance: active - Downloads: 4.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags code formatting tool, clang-format python package, c++ code formatter, automatic code style, llvm-based formatter, install clang-format pip, pre-commit code formatting, code-formatting, llvm-based, ci-cd-friendly [View on SkillFed](https://skillfed.io/packages/clang-format) · [View on PyPI](https://pypi.org/project/clang-format/)