Skip to content

Add clang-tidy reviews to CI #1407

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 12, 2023
Merged
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
18 changes: 18 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
Checks: >
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions,
readability-*,
-readability-avoid-unconditional-preprocessor-if,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-uppercase-literal-suffix,
clang-analyzer-*,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
performance-*,
portability-*,
FormatStyle: none
20 changes: 20 additions & 0 deletions .github/workflows/tidy-post.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: clang-tidy review post comments

on:
workflow_run:
workflows: ["clang-tidy-review"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: ZedThree/clang-tidy-review/post@v0.13.0
# lgtm_comment_body, max_comments, and annotations need to be set on the posting workflow in a split setup
with:
# adjust options as necessary
lgtm_comment_body: ''
annotations: false
max_comments: 25
23 changes: 23 additions & 0 deletions .github/workflows/tidy-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: clang-tidy-review

on:
pull_request:
branches:
- master

jobs:
clang-tidy-review:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: ZedThree/clang-tidy-review@v0.13.0
id: review
with:
lgtm_comment_body: ''
build_dir: build
cmake_command: cmake . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=on
split_workflow: true

- uses: ZedThree/clang-tidy-review/upload@v0.13.0