Skip to content

Commit eb57e02

Browse files
authored
Merge pull request #296 from githubdoe/JST/clang-tidy
adding clang-tidy review for pull requests
2 parents 8ff99d4 + 065f344 commit eb57e02

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

.clang-tidy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Checks: >
2+
clang-analyzer-*
3+
bugprone-*
4+
performance-unnecessary-*
5+
modernize-use-nullptr
6+
modernize-use-nodiscard

.github/workflows/build-linux.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ env:
1212

1313
jobs:
1414
build-linux:
15+
permissions:
16+
contents: read
17+
pull-requests: write
1518
strategy:
1619
fail-fast: false
1720
matrix:
@@ -20,7 +23,7 @@ jobs:
2023
steps:
2124
- uses: actions/checkout@v4
2225
- run: sudo apt update
23-
- run: sudo apt install -y apt-utils build-essential wget qt6-base-dev-tools qt6-declarative-dev qt6-multimedia-dev libqt6charts6-dev libqt6datavisualization6-dev libqt6svg6-dev libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libgl1-mesa-dev libglu1-mesa-dev
26+
- run: sudo apt install -y apt-utils build-essential wget qt6-base-dev-tools qt6-declarative-dev qt6-multimedia-dev libqt6charts6-dev libqt6datavisualization6-dev libqt6svg6-dev libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libgl1-mesa-dev libglu1-mesa-dev bear
2427
- run: wget -O qwt-${{env.QWT_version}}.zip https://sourceforge.net/projects/qwt/files/qwt/${{env.QWT_version}}/qwt-${{env.QWT_version}}.zip/download?use_mirror=pilotfiber
2528
- run: 7z x qwt-${{env.QWT_version}}.zip
2629
- run: cd qwt-${{env.QWT_version}} ; /usr/lib/qt6/bin/qmake
@@ -29,5 +32,21 @@ jobs:
2932
- run: /usr/lib/qt6/bin/qmake DFTFringe.pro
3033
- uses: ammaraskar/gcc-problem-matcher@master
3134
- run: echo "::add-matcher::.github/matcher/uic_matcher.json"
32-
- run: make -j4
35+
36+
- name: capture compile_commands.json from build
37+
run: bear -- make -j4
3338
- run: echo "::remove-matcher owner=uic-problem-matcher::"
39+
40+
- name: Run C++ Linter (clang-tidy)
41+
if: strategy.job-index == 0 #run only for first OS of the matrix
42+
uses: cpp-linter/cpp-linter-action@v2
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
style: '' # we don't want check from clang-format
47+
lines-changed-only: 'true' # Only lines in the diff that contain additions are analyzed. Avoid noise from existing code.
48+
thread-comments: 'update'
49+
tidy-checks: '' # rely solely on .clang-tidy file
50+
tidy-review: true
51+
passive-reviews: true
52+
ignore: 'bezier|boost|SingleApplication|spdlog|zernike|moc_*|ui_*|qwt*'

0 commit comments

Comments
 (0)