Skip to content
Closed
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
15 changes: 8 additions & 7 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Checks:
modernize-*,
performance-*,
portability-*,
readability-*

HeaderFilterRegex: 'src'
FormatStyle: file

readability-*,
-readability-function-cognitive-complexity,
-bugprone-suspicious-stringview-data-usage
WarningsAsErrors: ''
HeaderFilterRegex: ''
CheckOptions:
- key: readability-identifier-naming.StaticVariableCase
value: lower_case
Expand Down Expand Up @@ -52,9 +52,9 @@ CheckOptions:
- key: readability-identifier-naming.PrivateMethodCase
value: lower_case
- key: readability-identifier-naming.PublicMethodCase
value: camelCase
value: camelBack
- key: readability-identifier-naming.ProtectedMethodCase
value: camelCase
value: camelBack

- key: readability-identifier-naming.ConstexprVariableCase
value: UPPER_CASE
Expand All @@ -66,3 +66,4 @@ CheckOptions:

- key: readability-identifier-naming.NamespaceCase
value: CamelCase
...
14 changes: 0 additions & 14 deletions .github/workflows/check-code-formatting.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/clang-tidy-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: clang-tidy-ci
run-name: Run clang-tidy on PR

on: [pull_request]

jobs:
clang-tidy-ci:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build doxygen clang-tidy libglib2.0-dev
pip3 install pyyaml

- name: Configure, build and test
run: cmake --workflow --preset default-develop

- name: clang-tidy
run: |
# Ensure upstream remote exists and is up to date
git remote add upstream "https://github.com/${{ github.event.pull_request.base.repo.full_name }}"
git fetch --no-tags --no-recurse-submodules upstream "${{ github.event.pull_request.base.ref }}"

# Prepare directory for clang-tidy fixes
mkdir -p ${{ runner.temp }}/clang-tidy-fixes

# Generate diff from base branch and run clang-tidy
BASE_COMMIT=$(git merge-base HEAD "upstream/${{ github.event.pull_request.base.ref }}")
git diff -U0 "$BASE_COMMIT" | \
clang-tidy-diff -p1 \
-path "build/default-develop" \
-export-fixes "${{ runner.temp }}/clang-tidy-fixes/clang-tidy-fixes.yml"


- name: Export PR variables
run: |
echo "${{ github.event.number }}" > ${{ runner.temp }}/clang-tidy-fixes/pr_number
echo "${{ github.event.pull_request.head.repo.full_name }}" > ${{ runner.temp }}/clang-tidy-fixes/pr-head-repo
echo "${{ github.event.pull_request.head.sha }}" > ${{ runner.temp }}/clang-tidy-fixes/pr-head-sha

- uses: actions/upload-artifact@v4
with:
name: clang-tidy-fixes
path: |
${{ runner.temp }}/clang-tidy-fixes/*
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
name: Lint and Comment on PR
name: clang-tidy-comments
run-name: Post clang-tidy comments on PR

on:
workflow_run:
workflows: [push-build-test-lint-release]
workflows: [clang-tidy-ci]
types:
- completed

jobs:
lint-and-comment:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
clang-tidy-comments:
runs-on: ubuntu-latest
permissions:
actions: read
pull-requests: write

steps:
- name: 'Download artifact'
- name: 'Download clang-tidy-fixes'
uses: actions/download-artifact@v4
with:
name: common
name: clang-tidy-fixes
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
path: ${{ runner.temp }}
Expand All @@ -30,7 +29,7 @@ jobs:
echo "prn=$(cat pr_number)" >> $GITHUB_OUTPUT
echo "prhr=$(cat pr-head-repo)" >> $GITHUB_OUTPUT
echo "prhs=$(cat pr-head-sha)" >> $GITHUB_OUTPUT
if [ -f "clang-fixes.yml" ]; then
if [ -f "clang-tidy-fixes.yml" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
Expand All @@ -49,7 +48,6 @@ jobs:
uses: platisd/clang-tidy-pr-comments@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clang_tidy_fixes: ${{ runner.temp }}/clang-fixes.yml
clang_tidy_fixes: ${{ runner.temp }}/clang-tidy-fixes.yml
pull_request_id: ${{ steps.getprv.outputs.prn }}
request_changes: false

request_changes: false
52 changes: 0 additions & 52 deletions .github/workflows/code-format.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/conf-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
push:
tags:
- 'v*'
pull_request:
branches: [main, develop]
# pull_request:
# branches: [main, develop]

jobs:
build_test_package:
Expand Down Expand Up @@ -128,4 +128,3 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

13 changes: 13 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: build-and-checks

on: [pull_request]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --show-diff-on-failure
35 changes: 0 additions & 35 deletions .github/workflows/recreate-develop.yml

This file was deleted.

Loading
Loading