|
1 | | -<!-- markdownlint-disable MD036 MD041 MD033 --> |
| 1 | +--- |
| 2 | +hide: |
| 3 | + - navigation |
| 4 | + - toc |
| 5 | +--- |
2 | 6 |
|
3 | | -<p align="left"> |
4 | | - <img src="/static/readme-banner-small.png" width="512" height="141" alt="cpp-linter_brand_logo" /> |
5 | | -</p> |
| 7 | +<div class="hero" markdown> |
6 | 8 |
|
7 | | ---- |
| 9 | +# C/C++ linting that simply works |
| 10 | + |
| 11 | +**Professional static analysis for C/C++ code – automated, configurable, and fast. Integrate seamlessly into any workflow in minutes.** |
| 12 | + |
| 13 | +[Get started :material-rocket-launch:](getting-started.md){ .md-button .md-button--primary } |
| 14 | + |
| 15 | +</div> |
| 16 | + |
| 17 | +<div class="grid cards" markdown> |
| 18 | + |
| 19 | +- :material-github: **GitHub Action** |
| 20 | + |
| 21 | + --- |
| 22 | + |
| 23 | + Automated C++ linting in your CI/CD pipelines with zero configuration |
| 24 | + |
| 25 | + [:octicons-arrow-right-24: cpp-linter-action](https://cpp-linter.github.io/cpp-linter-action/) |
| 26 | + |
| 27 | +- :material-git: **Pre-commit Hooks** |
| 28 | + |
| 29 | + --- |
| 30 | + |
| 31 | + Catch issues before they reach your repository with Git hooks |
| 32 | + |
| 33 | + [:octicons-arrow-right-24: cpp-linter-hooks](https://github.com/cpp-linter/cpp-linter-hooks) |
| 34 | + |
| 35 | +- :fontawesome-brands-python: **Python Package** |
| 36 | + |
| 37 | + --- |
| 38 | + |
| 39 | + Powerful command-line tool and Python API for local development |
| 40 | + |
| 41 | + [:octicons-arrow-right-24: cpp-linter](https://cpp-linter.github.io/cpp-linter/) |
| 42 | + |
| 43 | + |
| 44 | +</div> |
8 | 45 |
|
9 | | -## Cpp Linter |
| 46 | +## Everything you need for C/C++ code quality |
10 | 47 |
|
11 | | -**Automated linting for your C/C++ code** |
| 48 | +<div class="grid cards" markdown> |
12 | 49 |
|
13 | | -### Get Started |
| 50 | +- :material-chart-line: **Built in Open Source** |
14 | 51 |
|
15 | | -Integrate Cpp Linter into your workflow with: |
| 52 | + --- |
16 | 53 |
|
17 | | -* [cpp-linter-action](https://github.com/cpp-linter/cpp-linter-action) — GitHub Action for CI pipelines |
18 | | -* [cpp-linter-hooks](https://github.com/cpp-linter/cpp-linter-hooks) — Pre-commit hooks for local development |
| 54 | + Open-source and permissively licensed. Bringing contributors together to empower impactful C/C++ lint projects in open source and beyond. |
19 | 55 |
|
20 | | -### Clang Tools — Simplified |
| 56 | +- :material-cog: **Zero Configuration** |
21 | 57 |
|
22 | | -We provide ready-to-use **binaries**, **Docker images**, and **Python wheels** of key `clang-tools`: |
| 58 | + --- |
23 | 59 |
|
24 | | -* [clang-tools-static-binaries](https://github.com/cpp-linter/clang-tools-static-binaries) |
25 | | -* [clang-tools-docker](https://github.com/cpp-linter/clang-tools-docker) |
26 | | -* [clang-tools-wheel](https://github.com/cpp-linter/clang-tools-wheel) |
| 60 | + Works out of the box with sensible defaults. Advanced users can customize every aspect to match their coding standards. |
27 | 61 |
|
28 | | -### Easy Installation |
| 62 | +- :material-devices: **Works Everywhere** |
| 63 | + |
| 64 | + --- |
| 65 | + |
| 66 | + GitHub Actions, Pre-commit, Command Line, Docker containers – integrate anywhere your code lives. |
| 67 | + |
| 68 | +</div> |
| 69 | + |
| 70 | +## Clang Tools Made Simple |
| 71 | + |
| 72 | +**No more complex installations or version conflicts.** Get `clang-format`, `clang-tidy`, `clang-query`, and more through your favorite package manager: |
| 73 | + |
| 74 | +<div class="grid" markdown> |
| 75 | + |
| 76 | +<div class="card-content" markdown> |
| 77 | +### :fontawesome-brands-python: **pip** |
| 78 | +```bash |
| 79 | +pip install clang-tools |
| 80 | +clang-tools --install 20 |
| 81 | +``` |
| 82 | +[:octicons-arrow-right-24: clang-tools-pip](https://github.com/cpp-linter/clang-tools-pip) |
| 83 | +</div> |
| 84 | + |
| 85 | +<div class="card-content" markdown> |
| 86 | +### :material-docker: **Docker** |
| 87 | +```bash |
| 88 | +docker pull xianpengshen/clang-tools |
| 89 | +``` |
| 90 | +[:octicons-arrow-right-24: clang-tools-docker](https://github.com/cpp-linter/clang-tools-docker) |
| 91 | +</div> |
| 92 | + |
| 93 | +<div class="card-content" markdown> |
| 94 | +### :material-download: **Python Wheels** |
| 95 | +```bash |
| 96 | +pip install clang-<name>-<version>.whl |
| 97 | +``` |
| 98 | +[:octicons-arrow-right-24: clang-tools-wheel](https://github.com/cpp-linter/clang-tools-wheel) |
| 99 | +</div> |
| 100 | + |
| 101 | +</div> |
| 102 | + |
| 103 | +## Quick Start |
| 104 | + |
| 105 | +=== "GitHub Actions" |
| 106 | + |
| 107 | + Add cpp-linter-action to your workflow in seconds: |
| 108 | + |
| 109 | + ```yaml |
| 110 | + steps: |
| 111 | + - uses: actions/checkout@v5 |
| 112 | + - uses: cpp-linter/cpp-linter-action@v2 |
| 113 | + id: linter |
| 114 | + env: |
| 115 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 116 | + with: |
| 117 | + style: 'file' # Use .clang-format config file |
| 118 | + tidy-checks: '' # Use .clang-tidy config file |
| 119 | + # only 'update' a single comment in a pull request thread. |
| 120 | + thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} |
| 121 | + - name: Fail fast?! |
| 122 | + if: steps.linter.outputs.checks-failed > 0 |
| 123 | + run: exit 1 |
| 124 | + ``` |
| 125 | +=== "Pre-commit" |
| 126 | + |
| 127 | + Add to your `.pre-commit-config.yaml`: |
| 128 | + |
| 129 | + ```yaml |
| 130 | + repos: |
| 131 | + - repo: https://github.com/cpp-linter/cpp-linter-hooks |
| 132 | + rev: v1.1.3 # Use the tag or commit you want |
| 133 | + hooks: |
| 134 | + - id: clang-format |
| 135 | + args: [--style=Google] # Other coding style: LLVM, GNU, Chromium, Microsoft, Mozilla, WebKit. |
| 136 | + - id: clang-tidy |
| 137 | + args: [--checks='boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*'] |
| 138 | + ``` |
| 139 | + |
| 140 | +=== "Command Line" |
| 141 | + |
| 142 | + Install and run locally: |
| 143 | + |
| 144 | + ```bash |
| 145 | + pip install cpp-linter |
| 146 | + cpp-linter --style=file --tidy-checks='-*,readability-*' src/ |
| 147 | + ``` |
| 148 | + |
| 149 | +--- |
29 | 150 |
|
30 | | -Prefer modern package managers? Install `clang-format`, `clang-tidy`, `clang-query`, and more via: |
| 151 | +<div class="community-section" markdown> |
31 | 152 |
|
32 | | -* [pip](https://github.com/cpp-linter/clang-tools-pip) |
33 | | -* [asdf](https://github.com/cpp-linter/asdf-clang-tools) |
| 153 | +## Join Our Community |
34 | 154 |
|
35 | | -## Contributing 💪 |
| 155 | +**Be part of a growing ecosystem of C/C++ developers who care about code quality.** |
36 | 156 |
|
37 | | -Thanks for your interest in contributing to [cpp-linter](https://github.com/cpp-linter)! |
| 157 | +[GitHub Discussions :fontawesome-brands-github:](https://github.com/cpp-linter/cpp-linter/discussions){ .md-button } |
| 158 | +<!-- [Discord Community :fontawesome-brands-discord:](https://discord.gg/cpp-linter){ .md-button } |
| 159 | +[Stack Overflow :fontawesome-brands-stack-overflow:](https://stackoverflow.com/questions/tagged/cpp-linter){ .md-button } --> |
38 | 160 |
|
39 | | -We welcome feedback, bug reports, and feature requests from the community! |
| 161 | +</div> |
0 commit comments