Skip to content
@cpp-linter

cpp-linter

Lint your C/C++ code in workflow

cpp-linter brand logo

Automated C/C++ linting and formatting for your CI/CD pipelines and local workflows.

Documentation License: MIT GitHub stars


📖 About

cpp-linter bundles the power of clang-format, clang-tidy, and other LLVM tools into packages that are easy to install, integrate, and maintain. Whether you’re linting a single file locally or enforcing code quality across dozens of repos in CI, cpp-linter has you covered.

We target C/C++ developers and DevOps engineers who want reliable clang tooling without the build-from-source headache. Our packages track the latest LLVM releases and cover Linux, macOS, and Windows on both x86_64 and Arm.


🧭 Which one should I use?

Not sure where to start? Pick the entry point that matches your workflow:

Your goal Use this How
Lint & format on GitHub PRs / pushes cpp-linter-action Add the action to your workflow
Catch issues locally before committing cpp-linter-hooks Add to your .pre-commit-config.yaml
Install the clang tools as a cross-platform CLI (most people) pip: clang-tools pip install clang-tools
Install on macOS the native way Homebrew tap brew tap cpp-linter/tap && brew install clang-tools
Manage tool versions across a polyglot team asdf asdf plugin add clang-tools https://github.com/cpp-linter/asdf-clang-tools
Run inside containers / custom CI images clang-tools-docker Pull the image
Just grab the raw static binary clang-tools-static-binaries Download from releases

💡 New here? For CI, start with cpp-linter-action. For local development, use cpp-linter-hooks. To install the underlying clang tools directly, pip install clang-tools works on every platform.


⚡ Quick example

Lint every pull request with cpp-linter-action — no local setup required:

# .github/workflows/cpp-linter.yml
name: cpp-linter
on: pull_request

jobs:
  cpp-linter:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: cpp-linter/cpp-linter-action@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          style: file       # format against your .clang-format
          tidy-checks: ''    # analyze against your .clang-tidy

The action posts inline annotations, a step summary, and (optionally) PR review suggestions. See the cpp-linter-action docs for all inputs and outputs.

📦 More packages — lower-level & specialized builds

The tools above are built on a few underlying distributions you can also use directly:

Project What it does
clang-tools-static-binaries The upstream source: statically-linked binaries for Linux, macOS, and Windows that every other distribution builds on.
clang-tools-wheel Python wheels that redistribute clang-format and clang-tidy.
clang-apply-replacements Standalone Python wheel for clang-apply-replacements.
clang-include-cleaner Standalone Python wheel for clang-include-cleaner — detects unused #include directives.

Browse every repository on the organization page.


👥 Maintainers

shenxianpeng
shenxianpeng
2bndy5
2bndy5

🤝 Contributing

We welcome contributions of all kinds — bug reports, feature requests, documentation improvements, and code.


Made with ❤️ by the cpp-linter community

Pinned Loading

  1. cpp-linter-action cpp-linter-action Public

    A Github Action for linting C/C++ code integrating clang-tidy and clang-format to collect feedback provided in the form of file-annotations, thread-comments, workflow step-summary, and Pull Request…

    143 24

  2. cpp-linter-hooks cpp-linter-hooks Public

    C/C++ pre-commit hooks powered by clang-format and clang-tidy

    Python 45 5

  3. cpp-linter cpp-linter Public

    cpp-linter core Python executable package

    Python 34 12

  4. clang-tools-pip clang-tools-pip Public

    Install clang-format, clang-tidy, clang-query, clang-apply-replacements and clang-include-cleaner binaries with clang-tools CLI.

    Python 10 1

  5. clang-tools-static-binaries clang-tools-static-binaries Public

    static-linked versions of clang tools for Linux, Mac OS X and Windows

    Python 18 4

  6. clang-tools-docker clang-tools-docker Public

    🐳 Clang Tools Docker image includes the clang-format and clang-tidy.

    HCL 15 1

Repositories

Showing 10 of 17 repositories

Top languages

Loading…

Most used topics

Loading…