Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/ai-coding-agents.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: Use cpp-linter with AI coding agents
description: Make clang-format and clang-tidy the check an AI coding agent runs after it edits C or C++ code, with configs for Claude Code, GitHub Copilot coding agent, AGENTS.md, pre-commit and pull requests.
hide:
- navigation
---

# Use cpp-linter with AI coding agents
Expand Down
2 changes: 0 additions & 2 deletions docs/discussion.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: Community
description: Where to ask about cpp-linter, report bugs and security problems, and contribute.
hide:
- navigation
---

# Community
Expand Down
10 changes: 5 additions & 5 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: Get started
description: Set up cpp-linter-action, the cpp-linter pre-commit hooks, the cpp-linter command or the clang tools, with the LLVM version you pin.
hide:
- navigation
---

# Get started
Expand Down Expand Up @@ -132,6 +130,8 @@ Ubuntu's packages and are no longer rebuilt. The same images are on Docker Hub a
`xianpengshen/clang-tools`.

Single tools are also on PyPI as Python wheels: `clang-format` and `clang-tidy` (the wheels
cpp-linter-hooks installs), [clang-apply-replacements](https://pypi.org/project/clang-apply-replacements/)
(LLVM 16 to 23) and [clang-include-cleaner](https://pypi.org/project/clang-include-cleaner/)
(LLVM 22 and 23).
cpp-linter-hooks installs), and from cpp-linter
[clang-include-cleaner](https://pypi.org/project/clang-include-cleaner/),
[clang-apply-replacements](https://pypi.org/project/clang-apply-replacements/),
[llvm-cov](https://pypi.org/project/llvm-cov/) and [ccache-bin](https://pypi.org/project/ccache-bin/).
[C and C++ tools, packaged](packages.md) lists every package, with the LLVM versions each one has.
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Set the same LLVM version in each tool, and laptops and CI run the same major re
| Locally or in other CI | cpp-linter, the Python command behind the action | <https://cpp-linter.github.io/cpp-linter/> |
| Just the clang tools, by LLVM version | clang-tools (pip), npm, asdf, Docker, Homebrew | <https://cpp-linter.github.io/clang-tools-pip/> |
| Static clang-format and clang-tidy binaries | clang-tools-static-binaries | <https://cpp-linter.github.io/clang-tools-static-binaries/> |
| LLVM tools and ccache as Python wheels, plus npm, Homebrew, asdf and Docker | clang-include-cleaner, clang-apply-replacements, llvm-cov, ccache-bin and more | <https://cpp-linter.github.io/packages/> |
| Version 2, a rewrite in Rust (release candidates) | cpp-linter-rs | <https://cpp-linter.github.io/cpp-linter-rs/> |

The action and clang-tools cover LLVM 12 to 23. The clang-tidy pre-commit hook covers LLVM 13 to 23.
Expand Down
2 changes: 0 additions & 2 deletions docs/other-ci.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: Other CI systems
description: Run clang-format and clang-tidy on the files a branch changes in GitLab CI, Jenkins, Azure Pipelines and Bitbucket Pipelines, with the cpp-linter command.
hide:
- navigation
---

# Other CI systems
Expand Down
55 changes: 51 additions & 4 deletions docs/overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@

{% block header %}
{% set links = [
("Get started", "getting-started/" | url),
("Tools", "#tools"),
("Docs", "getting-started/" | url),
("Playground", "playground/" | url),
("Why cpp-linter", "why-cpp-linter/" | url),
("Showcase", "showcase/" | url),
("Blog", "blog/" | url),
("Community", "discussion/" | url),
] %}
Expand Down Expand Up @@ -169,7 +167,7 @@ <h1 class="cl-hero__title">
},
{
"title": "Just the clang tools", "name": "clang-tools", "icon": "octicons/package-24",
"text": "clang-format, clang-tidy and friends for LLVM 12 to 23 via pip, npm or asdf, plus Docker images (up to 22) and a macOS Homebrew tap (19 to 23).",
"text": "clang-format, clang-tidy and the LLVM tools around them, for LLVM 12 to 23, from PyPI, npm, Homebrew, asdf or Docker.",
"code": "pip install clang-tools\nclang-tools install clang-format clang-tidy --version 21",
"href": "https://cpp-linter.github.io/clang-tools-pip/", "cta": "Read the docs",
},
Expand Down Expand Up @@ -237,6 +235,54 @@ <h3>{{ title }}</h3>
</div>
</section>

{% set packages = [
("clang-include-cleaner", "Finds unused and missing #include directives.", "LLVM 22–23", "clang-include-cleaner"),
("clang-apply-replacements", "Applies the fixes clang-tidy exports to your sources.", "LLVM 16–23", "clang-apply-replacements"),
("llvm-cov", "llvm-cov and llvm-profdata, for source-based code coverage.", "LLVM 12–23", "llvm-cov"),
("ccache-bin", "ccache, the compiler cache, from ccache's own release binaries.", "ccache 4", "ccache-bin"),
] %}
<section class="cl-band cl-band--white" id="packages">
<div class="cl-wrap">
<div class="cl-pkg">
<div>
<p class="cl-eyebrow">Also from cpp-linter</p>
<h2 class="cl-h2">The tools themselves, for any package manager</h2>
<p class="cl-sub">We build clang-format, clang-tidy and the LLVM tools around them as static binaries, then publish the same files to PyPI, npm, Homebrew, asdf and Docker. Install the version you pin, with no LLVM to install and nothing to compile.</p>
<dl class="cl-facts">
<div><dt>12–23</dt><dd>LLVM versions</dd></div>
<div><dt>6</dt><dd>platforms</dd></div>
<div><dt>540k+</dt><dd>binary downloads</dd></div>
</dl>
<a class="cl-link" href="{{ 'packages/' | url }}">See every package {{ arrow }}</a>
</div>
<div class="cl-window">
<div class="cl-window__bar">
<span class="cl-window__file">LLVM 22 from four package managers</span>
</div>
<pre class="cl-code cl-code--shell"><span class="c"># PyPI: pip, uv, pipx</span>
<span class="p">$</span> pip install <span class="s">"llvm-cov==22.*"</span>
<span class="p">$</span> uv tool install <span class="s">"clang-include-cleaner==22.*"</span>
<span class="c"># npm</span>
<span class="p">$</span> npm install -D <span class="s">@cpp-linter/clang-tidy@22</span>
<span class="c"># Homebrew</span>
<span class="p">$</span> brew install <span class="s">cpp-linter/tap/clang-format@22</span>
<span class="c"># Docker</span>
<span class="p">$</span> docker pull <span class="s">ghcr.io/cpp-linter/clang-tools:22</span></pre>
</div>
</div>
<div class="cl-wheels">
{% for name, text, range, pypi in packages %}
<a class="cl-wheel" href="https://pypi.org/project/{{ pypi }}/">
<span class="cl-wheel__top"><span class="cl-wheel__badge">PyPI</span><span class="cl-wheel__range">{{ range }}</span></span>
<code class="cl-wheel__name">{{ name }}</code>
<span class="cl-wheel__text">{{ text }}</span>
<span class="cl-wheel__more">View on PyPI {{ arrow }}</span>
</a>
{% endfor %}
</div>
</div>
</section>

<section class="cl-band">
<div class="cl-wrap">
<div class="cl-head">
Expand Down Expand Up @@ -457,6 +503,7 @@ <h2>Maintained by two volunteers</h2>
<a href="https://github.com/cpp-linter/cpp-linter-hooks">pre-commit hooks</a>
<a href="https://cpp-linter.github.io/cpp-linter/">Python CLI</a>
<a href="https://cpp-linter.github.io/clang-tools-pip/">clang-tools</a>
<a href="{{ 'packages/#python-wheels' | url }}">Python wheels</a>
<a href="https://cpp-linter.github.io/clang-tools-static-binaries/">Static binaries</a>
<a href="https://github.com/cpp-linter/clang-tools-npm">npm packages</a>
<a href="https://github.com/cpp-linter/clang-tools-docker">Docker images</a>
Expand Down
157 changes: 157 additions & 0 deletions docs/packages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
---
title: C and C++ tools, packaged
description: clang-include-cleaner, clang-apply-replacements, llvm-cov and ccache as Python wheels on PyPI, and clang-format and clang-tidy on npm, Homebrew, asdf and Docker, for LLVM 12 to 23 on six platforms.
---

# C and C++ tools, packaged

cpp-linter builds clang-format, clang-tidy and the LLVM tools around them as static binaries for
every LLVM version from 12 to 23, on Linux, macOS and Windows, x86-64 and ARM64. The same files
then go to PyPI, npm, Homebrew, asdf and Docker, so you install the tool at the version you pin,
with the package manager your project already uses. There is no LLVM to install and nothing to
compile.

<div class="cl-stats" markdown>

<div><strong>12–23</strong><span>LLVM versions</span></div>
<div><strong>6</strong><span>platforms, x86-64 and ARM64</span></div>
<div><strong>540k+</strong><span>binary downloads</span></div>
<div><strong>Attested</strong><span>build provenance on every file</span></div>

</div>

## Python wheels

`pip install`, `uv tool install` or `pipx install` puts the command on your `PATH`. The package
version is the tool's version, so `pip install "llvm-cov==22.*"` installs llvm-cov from LLVM 22.

<div class="grid cards cl-wheel-cards" markdown>

- **clang-include-cleaner** <span class="cl-range">LLVM 22–23</span>

---

Finds unused and missing `#include` directives in C and C++ files.

```bash
pip install clang-include-cleaner
```

[PyPI](https://pypi.org/project/clang-include-cleaner/) ·
[GitHub](https://github.com/cpp-linter/clang-include-cleaner-wheel)

- **clang-apply-replacements** <span class="cl-range">LLVM 16–23</span>

---

Applies the fixes clang-tidy exports to your source files.

```bash
pip install clang-apply-replacements
```

[PyPI](https://pypi.org/project/clang-apply-replacements/) ·
[GitHub](https://github.com/cpp-linter/clang-apply-replacements-wheel)

- **llvm-cov** <span class="cl-range">LLVM 12–23</span>

---

`llvm-cov` and `llvm-profdata`, for clang's source-based code coverage.

```bash
pip install llvm-cov
```

[PyPI](https://pypi.org/project/llvm-cov/) ·
[GitHub](https://github.com/cpp-linter/llvm-cov-wheel)

- **ccache-bin** <span class="cl-range">ccache 4</span>

---

`ccache`, the C and C++ compiler cache, from ccache's own release binaries.

```bash
pip install ccache-bin
```

[PyPI](https://pypi.org/project/ccache-bin/) ·
[GitHub](https://github.com/cpp-linter/ccache-wheel)

</div>

Every wheel:

- holds the tool's binary unchanged, plus clang's builtin headers when the tool parses code;
- contains no Python code, so it works with any Python 3, and is tested with pip, uv,
`uv tool install` and `pip install --user` on every platform before it is released;
- has Linux wheels for glibc 2.17 and later and for musl, so it also installs on Alpine;
- is published from GitHub Actions with PyPI Trusted Publishing, with an attestation that names
the commit it was built from.

Pin the tools next to the rest of your development dependencies, and every laptop and CI job runs
the same version:

```toml title="pyproject.toml"
[dependency-groups]
dev = ["clang-include-cleaner==22.*", "llvm-cov==22.*", "ccache-bin"]
```

Or run one without installing it, for example in CI: `uvx clang-include-cleaner --help`, or
`pipx run llvm-cov --version` on GitHub-hosted runners, which ship with pipx.

clang-format and clang-tidy already have widely used wheels on PyPI from another project,
[clang-format](https://pypi.org/project/clang-format/) and
[clang-tidy](https://pypi.org/project/clang-tidy/); cpp-linter-hooks installs those. For LLVM
versions they do not have, or to install several tools at once, use
[clang-tools](https://cpp-linter.github.io/clang-tools-pip/), which installs the static binaries
by version:

```bash
pip install clang-tools
clang-tools install clang-format clang-tidy --version 21
```

## Other package managers

| Package | LLVM | Runs on | Install |
| --- | --- | --- | --- |
| [npm packages](https://github.com/cpp-linter/clang-tools-npm) | 12 to 23 | Linux, macOS, Windows on x86-64 and ARM64 | `npm install --save-dev @cpp-linter/clang-format@21 @cpp-linter/clang-tidy@21` |
| [Homebrew tap](https://github.com/cpp-linter/homebrew-tap) | 19 to 23 | macOS | `brew install cpp-linter/tap/clang-format@21` |
| [asdf plugin](https://github.com/cpp-linter/asdf-clang-tools) | 12 to 23 | wherever asdf runs | `asdf plugin add clang-format https://github.com/cpp-linter/asdf-clang-tools.git` |
| [Docker images](https://github.com/cpp-linter/clang-tools-docker) | 7 to 23 | Docker on x86-64 and ARM64 | `docker pull ghcr.io/cpp-linter/clang-tools:21` |
| [Static binaries](https://cpp-linter.github.io/clang-tools-static-binaries/) | 12 to 23 | Linux, macOS, Windows on x86-64 and ARM64 | one file from the download page |

## One build behind every package

<div class="cl-flow" markdown>

<div class="cl-flow__step"><span class="cl-flow__label">Upstream</span><strong>LLVM release</strong><span>12 to 23, each at its newest patch release</span></div>
<div class="cl-flow__step cl-flow__step--main"><span class="cl-flow__label">Built once</span><strong>Static binaries</strong><span>6 platforms, checksums and build attestations</span></div>
<div class="cl-flow__step"><span class="cl-flow__label">Published to</span><strong>PyPI · npm · Homebrew · asdf · Docker</strong><span>the same files, unchanged</span></div>

</div>

A new LLVM release starts a build of the
[static binaries](https://cpp-linter.github.io/clang-tools-static-binaries/) on all six
platforms. When it is published, a bot opens the update pull request for each wheel, and the new
wheels are released once they pass their tests on every platform. So an LLVM version runs the same
`clang-tidy` whether it comes from clang-tools, npm, Homebrew, asdf or Docker. The build and
release workflows the wheels share are in [cpp-linter/wheels](https://github.com/cpp-linter/wheels).

## Check what you install

Each static binary and each wheel has a build provenance attestation. To check one with the
GitHub CLI:

```bash
gh attestation verify clang-format-22_linux-amd64 --repo cpp-linter/clang-tools-static-binaries
pip download --no-deps "llvm-cov==22.*"
gh attestation verify llvm_cov-*.whl --repo cpp-linter/llvm-cov-wheel
```

The static binaries also come with `SHA512SUMS`. Their
[download page](https://cpp-linter.github.io/clang-tools-static-binaries/) shows how to check a
download, and the [security policy](https://github.com/cpp-linter/clang-tools-static-binaries/blob/master/SECURITY.md#checking-where-a-binary-was-built)
explains what an attestation proves.
2 changes: 0 additions & 2 deletions docs/showcase.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: Who uses cpp-linter
description: Open-source projects that run cpp-linter-action, ranked by GitHub stars, and some that use cpp-linter-hooks.
hide:
- navigation
---

# Who uses cpp-linter
Expand Down
2 changes: 0 additions & 2 deletions docs/sponsor.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
description: Sponsor cpp-linter through GitHub Sponsors or Open Collective. Sponsor tiers include your logo on the website and READMEs and thanks in release notes.
hide:
- navigation
---

# Sponsor cpp-linter
Expand Down
Loading