Skip to content

Commit

Permalink
mike-lischke#132 Run Clang-Tidy only on changed files
Browse files Browse the repository at this point in the history
Signed-off-by: vityaman <[email protected]>
  • Loading branch information
vityaman committed Jul 29, 2024
1 parent 8756dfa commit 64ed42e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}

- name: Get changed sources
id: changed-sources
uses: tj-actions/changed-files@v44
with:
files: |
ports/cpp/**.cpp
ports/cpp/**.hpp
run: |
if ${{ github.event_name == 'pull_request' }}; then
echo "files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
else
echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
fi
- name: Install dependencies
run: |
Expand Down Expand Up @@ -73,7 +76,7 @@ jobs:
- name: Clang-Tidy
if: steps.changed-sources.outputs.any_changed == 'true'
env:
CHANGED_SOURCES: ${{ steps.changed-sources.outputs.all_changed_files }}
CHANGED_SOURCES: ${{ steps.changed-sources.outputs.files }}
working-directory: ${{github.workspace}}/ports/cpp
run: |
for file in ${CHANGED_SOURCES}; do
Expand Down
25 changes: 12 additions & 13 deletions ports/cpp/.clang-tidy
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
---
Checks: '*,
-llvmlibc-callee-namespace,
-llvmlibc-implementation-in-namespace,
-llvmlibc-restrict-system-libc-headers,
-llvmlibc-inline-function-decl,
-llvm-header-guard,
-llvm-include-order,
-altera-unroll-loops,
-altera-struct-pack-align,
-altera-id-dependent-backward-branch,
-fuchsia-default-arguments-declarations,
-fuchsia-default-arguments-calls,
Checks: '-*,
bugprone-*,
cert-*,
concurrency-*,
cppcoreguidelines-*,
google-*,
hicpp-*,
misc-*,
-misc-no-recursion,
modernize-*,
-modernize-use-trailing-return-type,
-misc-no-recursion'
performance-*,
readability-*'
WarningsAsErrors: '*'
HeaderFileExtensions:
- hpp
Expand Down

0 comments on commit 64ed42e

Please sign in to comment.