Skip to content
Closed
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
50 changes: 50 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,27 @@

Welcome to cpp-linter! This guide will help you integrate C/C++ linting into your workflow quickly and efficiently.

## What is cpp-linter?

cpp-linter connects the standard LLVM linting tools, `clang-format` and `clang-tidy`, to the places where C/C++ projects need checks: pull requests, pre-commit hooks, local scripts, and CI jobs.

- `clang-format` checks formatting against a named style or your `.clang-format` file.
- `clang-tidy` runs static-analysis and modernization checks, usually configured by `.clang-tidy`.
- cpp-linter packages those tools into integrations with consistent defaults, reporting, and failure controls.

## Choose Your Integration

<!-- markdownlint-disable MD033 -->

Select the method that best fits your development workflow:

| Use case | Recommended entry point |
| --- | --- |
| GitHub pull request checks | [cpp-linter-action](https://cpp-linter.github.io/cpp-linter-action/) |
| Local checks before commits | [cpp-linter-hooks](https://github.com/cpp-linter/cpp-linter-hooks) |
| Custom scripts or CI jobs | [cpp-linter CLI](https://cpp-linter.github.io/cpp-linter/) |
| High-performance local runs | [cpp-linter-rs](https://cpp-linter.github.io/cpp-linter-rs/) |

<div class="grid cards" markdown>

- :material-github: **GitHub Actions**
Expand Down Expand Up @@ -52,6 +67,41 @@ Select the method that best fits your development workflow:

</div>

## Minimal Examples

=== "GitHub Actions"

```yaml
steps:
- uses: actions/checkout@v5
- uses: cpp-linter/cpp-linter-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
tidy-checks: ""
```

=== "Pre-commit"

```yaml
repos:
- repo: https://github.com/cpp-linter/cpp-linter-hooks
rev: v1.2.0
hooks:
- id: clang-format
args: [--style=file]
- id: clang-tidy
args: [--checks=-*,bugprone-*,performance-*,readability-*]
```

=== "Command Line"

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

## Clang Tools Distribution

<div class="grid cards" markdown>
Expand Down
67 changes: 6 additions & 61 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ template: home.html
title: C/C++ Linting
---

<!-- markdownlint-disable MD041 MD033 MD036 MD025 -->

# C/C++ Linting

## Everything you need for linting C/C++ code
<!-- markdownlint-disable MD041 MD033 MD036 -->

<div class="grid cards" markdown>

Expand All @@ -34,21 +30,13 @@ title: C/C++ Linting

</div>

<div class="grid" markdown>

</div>

## Trusted by developers worldwide
## Used across open-source projects

<div class="trusted-by" markdown>

**Join thousands of developers and organizations using cpp-linter in production**
Examples of public GitHub organizations and projects where cpp-linter usage has been seen. This list is a discovery aid, not an endorsement.

<div class="logo-grid">
<div class="logo-item">
<img src="https://github.com/microsoft.png" alt="Microsoft" title="Microsoft">
<span>Microsoft</span>
</div>
<div class="logo-item">
<img src="https://github.com/apache.png" alt="Apache" title="Apache">
<span>Apache</span>
Expand Down Expand Up @@ -93,18 +81,6 @@ title: C/C++ Linting
<img src="https://github.com/LedgerHQ.png" alt="LedgerHQ" title="LedgerHQ">
<span>LedgerHQ</span>
</div>
<div class="logo-item">
<img src="https://github.com/LLNL.png" alt="LLNL" title="LLNL">
<span>LLNL</span>
</div>
<div class="logo-item">
<img src="https://github.com/cohere-ai.png" alt="cohere" title="cohere">
<span>cohere</span>
</div>
<div class="logo-item">
<img src="https://github.com/diasurgical.png" alt="Diasurgical" title="Diasurgical">
<span>Diasurgical</span>
</div>
<div class="logo-item">
<img src="https://github.com/KhronosGroup.png" alt="Khronos Group" title="Khronos Group">
<span>Khronos Group</span>
Expand All @@ -121,31 +97,8 @@ title: C/C++ Linting
<img src="https://github.com/Cambridge-ICCS.png" alt="Cambridge ICCS" title="Cambridge ICCS">
<span>Cambridge ICCS</span>
</div>
<div class="logo-item">
<img src="https://github.com/openMSL.png" alt="OpenMSL" title="OpenMSL">
<span>OpenMSL</span>
</div>
<div class="logo-item">
<img src="https://github.com/xemu-project.png" alt="Xemu Project" title="Xemu Project">
<span>Xemu Project</span>
</div>
</div>

<!-- <div class="stats-grid">
<div class="stat">
<strong>1,000+</strong>
<span>GitHub Users</span>
</div>
<div class="stat">
<strong>20K+</strong>
<span>Downloads/Month</span>
</div>
<div class="stat">
<strong>50+</strong>
<span>Contributors</span>
</div>
</div> -->

</div>

## Quick Start
Expand Down Expand Up @@ -179,18 +132,10 @@ title: C/C++ Linting
- repo: https://github.com/cpp-linter/cpp-linter-hooks
rev: v1.2.0 # Use the tag or commit you want
hooks:
- id: clang-format
- id: clang-format
args: [--style=Google] # Other coding style: LLVM, GNU, Chromium, Microsoft, Mozilla, WebKit.
- id: clang-tidy
args:
- --checks='boost-*
- bugprone-*
- performance-*
- readability-*
- portability-*
- modernize-*
- clang-analyzer-*
- cppcoreguidelines-*'
- id: clang-tidy
args: [--checks=-*,bugprone-*,performance-*,readability-*]
```

=== "Command Line"
Expand Down
Loading