cpp-linter/cpp-linter-action
GitHub: cpp-linter/cpp-linter-action
集成了 clang-tidy 和 clang-format 的 GitHub Action,为 C/C++ 项目在 CI 流程中提供自动化的代码质量检查与多维反馈。
Stars: 141 | Forks: 23
# C/C++ Linter Action | clang-format & clang-tidy

[](https://github.com/marketplace/actions/c-c-linter)
[](https://github.com/cpp-linter/cpp-linter-action/actions/workflows/cpp-linter.yml)
[](https://github.com/cpp-linter/cpp-linter-action/actions/workflows/mkdocs-deploy.yml)
[](https://cpp-linter.github.io/)
一个用于对 C/C++ 代码进行 linting 的 GitHub Action,集成了 clang-tidy 和 clang-format
用于收集以以下形式提供的反馈:
[`file-annotations`][file-annotations]、[`thread-comments`][thread-comments]、
工作流 [`step-summary`][step-summary],以及 Pull Request 审查(通过
[`tidy-review`][tidy-review] 或 [`format-review`][format-review])。
## 用法
在你的项目中创建一个新的 GitHub Actions 工作流,例如在 [.github/workflows/cpp-linter.yml](https://github.com/cpp-linter/cpp-linter-action/blob/main/.github/workflows/cpp-linter.yml)
该文件的内容应采用以下格式。
```
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
```
有关我们所有可用输入参数和输出变量的详细说明,请参阅我们的
[输入和输出文档][io-doc]。
另请参阅我们的[示例配方][recipes-doc]。
## 使用情况
Microsoft
Apache
NASA
Samsung
TheAlgorithms
CachyOS
Nextcloud
Jupyter
NNStreamer
imgproxy
Zondax
AppNeta
Chocolate Doom
and many more.
标签:C/C++, SOC Prime, 事务性I/O, 开发工具, 逆向工具, 静态检查