Skip to content

Commit

Permalink
Add clang-tidy PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmit799 committed Oct 9, 2023
1 parent 3d957a3 commit 57c1ed1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,performance-*,portability-*,modernize-use-nullptr'
WarningsAsErrors: ''
HeaderFilterRegex: ''
...
36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint
on: [pull_request]

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

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install clang-tidy
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ gcc libssl-dev prometheus-cpp-dev clang-tidy
- name: Prepare compile_commands.json
run: |
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DARDOS_WANT_DB_SERVER=OFF
- name: Create results directory
run: |
mkdir clang-tidy-result
- name: Analyze
run: |
git diff -U0 HEAD^ | clang-tidy-diff -p1 -path build -export-fixes clang-tidy-result/fixes.yml
- name: Post review
uses: platisd/clang-tidy-pr-comments@master
with:
github_token: ${{ github.token }}
clang_tidy_fixes: clang-tidy-result/fixes.yml
request_changes: true
suggestions_per_comment: 10

0 comments on commit 57c1ed1

Please sign in to comment.