Skip to content

C/C++ linting that just works

Automated, configurable, and reliable linting for your C/C++ projects — set up in minutes.

Get started

Home

  • Built in Open Source


    Open-source and MIT-licensed. Bringing contributors together to empower impactful C/C++ lint projects in open source and beyond.

  • Zero Configuration


    Works out of the box with sensible defaults. Advanced users can customize every aspect to match their coding standards.

  • Works Everywhere


    GitHub Actions, Pre-commit, Command Line, Docker containers and more – integrate anywhere your code lives.

Used across open-source projects

Examples of public GitHub organizations and projects where cpp-linter usage has been seen. This list is a discovery aid, not an endorsement.

Apache Apache
NASA NASA
Samsung Samsung
TheAlgorithms TheAlgorithms
Nextcloud Nextcloud
CachyOS CachyOS
Qualcomm Qualcomm
Zondax Zondax
NNStreamer NNStreamer
Chocolate Doom Chocolate Doom
LedgerHQ LedgerHQ
Khronos Group Khronos Group
man-group Man Group
Stanford SSI Stanford SSI
Cambridge ICCS Cambridge ICCS

Quick Start

Add cpp-linter-action to your workflow in seconds:

steps:
  - uses: actions/checkout@v5
  - uses: cpp-linter/cpp-linter-action@v2
    id: linter
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    with:
      style: 'file'  # Use .clang-format config file
      tidy-checks: '' # Use .clang-tidy config file
      # only 'update' a single comment in a pull request thread.
      thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
  - name: Fail fast?!
    if: steps.linter.outputs.checks-failed > 0
    run: exit 1

Add to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/cpp-linter/cpp-linter-hooks
    rev: v1.2.0  # Use the tag or commit you want
    hooks:
      - id: clang-format
        args: [--style=Google] # Other coding style: LLVM, GNU, Chromium, Microsoft, Mozilla, WebKit.
      - id: clang-tidy
        args: [--checks=-*,bugprone-*,performance-*,readability-*]

Install and run locally:

pip install cpp-linter
cpp-linter --style=file --tidy-checks='-*,readability-*' src/

Join Our Community

Be part of a growing ecosystem of C/C++ developers who care about code quality.

GitHub Discussions