Skip to main content

Install clang-tools (clang-format, clang-tidy, clang-query, clang-apply-replacements, clang-include-cleaner) with pip

Project description

PyPI version Platform Test codecov SonarCloud Downloads cpp-linter hub

Easily install clang-format, clang-tidy, clang-query, clang-apply-replacements, and clang-include-cleaner static binaries or Python wheels using the clang-tools CLI.

[!IMPORTANT] This package only manages binary executables (& corresponding symbolic links) that are installed using this package's executable script. It does not intend to change or modify any binary executable installed from other sources (like LLVM releases).

For Python wheels, this CLI supports clang-format, clang-tidy, clang-include-cleaner, and clang-apply-replacements tools.

📖 Full documentation: cpp-linter.github.io/clang-tools-pip

Features

  • Install clang-format, clang-tidy, clang-query, clang-apply-replacements, and clang-include-cleaner via a single clang-tools CLI.

  • Supports both static binaries (standalone executables) and Python wheels (installed via pip).

  • Automatically uses static binaries when available; falls back to wheels if not.

  • Works on Linux, macOS, and Windows (x86_64 and ARM64).

  • Choose a specific LLVM version (11–22) or install the latest.

  • Install only the tools you need with --tool.

  • Uses SHA512 checksums to verify downloaded binaries.

  • Creates unversioned symlinks (e.g., clang-format) alongside versioned binaries (clang-format-18) for convenience.

    [!NOTE] To create symbolic links on Windows, you must enable developer mode from the Windows settings under "Privacy & security" > "For developers" category.

  • Install to any directory with --directory.

  • Uninstall with clang-tools uninstall.

Install clang-tools CLI

[!TIP] It is recommended to use this package in a virtual environment.

python -m venv env-name
source env-name/bin/activate  # Linux
./env-name/Scripts/activate   # Windows

Install clang-tools command with pip:

pip install clang-tools

Install clang-tools from git repo:

pip install git+https://github.com/cpp-linter/clang-tools-pip.git@main

CLI Usage

For a full list of CLI options, see the documentation.

Install binaries

# Install version 13 binaries (auto-detects binary vs wheel)
clang-tools install 13

# Force binary installation
clang-tools install 13 --binary

# Install to a specified directory
clang-tools install 13 --directory .

# Install specific tools
clang-tools install 14 --tool clang-format clang-query

If the installed directory is in your path:

clang-format-13 --version
# clang-format version 13.0.0

Install wheels

# Install latest clang-format wheel
clang-tools install clang-format --wheel

# Install specific version
clang-tools install clang-format --wheel --version 21

[!IMPORTANT] Wheel installation is primarily intended for cpp-linter projects. For general use, install wheels directly using pip, pipx, or uv.

Supported Clang Tools

clang tools binaries

  • clang-format
  • clang-tidy
  • clang-query
  • clang-apply-replacements
  • clang-include-cleaner

For more details, visit clang-tools-static-binaries.

clang tools Python wheels

Check the respective PyPI pages for available versions and platform support.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clang_tools-1.0.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file clang_tools-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: clang_tools-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for clang_tools-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 934f9d2ea93c16f3b93907a1b106d4fb3c628b5d72ab2dec93670a5235eb9b8a
MD5 0c914a594874e79bbc6e7e7b4a1a6ffc
BLAKE2b-256 349886b0216a6194e36bab608eef3a516df4548de4a99eb8f6abc5680e3614d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page