From 277f3b15df0bcba36975df4884b55a94b1c50957 Mon Sep 17 00:00:00 2001 From: Daljit Singh Date: Mon, 30 Oct 2023 11:22:12 +0000 Subject: [PATCH 1/2] Add configuration file for clang-tidy --- .clang-tidy | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000000..0a147dd0d3 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,16 @@ +Checks: > + -*, + bugprone-*, + clang-analyzer-*, + concurrency-*, + cppcoreguidelines-*, + misc-*, + performance-*, + portability-*, + readability-*, + -bugprone-easily-swappable-parameters, + -cppcoreguidelines-avoid-magic-numbers, + -readability-braces-around-statements, + -readability-identifier-length, + -readability-magic-numbers, +HeaderFilterRegex: '*.(h|hpp)' From 01d4667ce5a7e78207814b243fe9e91e0b1a2093 Mon Sep 17 00:00:00 2001 From: Daljit Singh Date: Mon, 30 Oct 2023 12:11:42 +0000 Subject: [PATCH 2/2] Add clang-tidy integration in CI --- .github/workflows/clang-tidy.yml | 18 ++++++++++++++++++ CMakeLists.txt | 1 + 2 files changed, 19 insertions(+) create mode 100644 .github/workflows/clang-tidy.yml diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml new file mode 100644 index 0000000000..72da091ec2 --- /dev/null +++ b/.github/workflows/clang-tidy.yml @@ -0,0 +1,18 @@ +name: clang-tidy-review + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: ZedThree/clang-tidy-review@v0.14.0 + id: review + with: + apt_packages: g++,libqt5opengl5-dev,libqt5svg5-dev,libglvnd-dev,libeigen3-dev,zlib1g-dev,libfftw3-dev,ninja-build + cmake_command: cmake . -DCMAKE_EXPORT_COMPILE_COMMANDS=on + + - uses: ZedThree/clang-tidy-review/upload@v0.14.0 + id: upload-review diff --git a/CMakeLists.txt b/CMakeLists.txt index 841f322a13..fac42d39ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,4 +137,5 @@ add_custom_target(Github SOURCES .github/workflows/package-macos-anaconda.yml .github/workflows/package-macos-native.yml .github/workflows/package-windows-msys2.yml + .github/workflows/clang-tidy.yml )