From f6cbaced6345b93140f6701103268ea482d177af Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 5 Dec 2024 10:34:35 +1100 Subject: [PATCH 1/8] Enable linting step --- .github/workflows/{lint.yaml.todo => lint.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{lint.yaml.todo => lint.yaml} (100%) diff --git a/.github/workflows/lint.yaml.todo b/.github/workflows/lint.yaml similarity index 100% rename from .github/workflows/lint.yaml.todo rename to .github/workflows/lint.yaml From 756da6cf7030de1f40f7818f5f3ac7c6d5757e9c Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 5 Dec 2024 12:37:15 +1100 Subject: [PATCH 2/8] Update linting step --- .github/workflows/lint.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index eab8307..bea4d41 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -11,17 +11,21 @@ on: - master jobs: - lint: + clang-tidy: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - uses: cpp-linter/cpp-linter-action@v2 + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - submodules: recursive - - name: Run clang-tidy - uses: HorstBaerbel/action-clang-tidy@1.2 - with: - scandir: 'src' - builddir: 'build' \ No newline at end of file + ignore: "build|plugins|qwt|ui_tmp|unit_test|pythonqt" + ignore-format: "build|plugins|qwt|ui_tmp|unit_test|pythonqt" + thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} + - name: Failure + if: steps.linter.outputs.checks-failed > 0 + run: exit 1 \ No newline at end of file From 75710f8fed3e89325faebcda223cccf6cbae3aeb Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 5 Dec 2024 12:43:22 +1100 Subject: [PATCH 3/8] Change a file --- .github/workflows/lint.yaml | 16 +++++++++------- src/data_source.cpp | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index bea4d41..64b9930 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -3,12 +3,14 @@ name: Code Style on: - push: - branches: - - master +on: pull_request: - branches: - - master + branches: [main, master] + paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '*.pro'] + push: + branches: [main, master] + paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '*.pro'] + jobs: clang-tidy: @@ -23,8 +25,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - ignore: "build|plugins|qwt|ui_tmp|unit_test|pythonqt" - ignore-format: "build|plugins|qwt|ui_tmp|unit_test|pythonqt" + ignore: "build|plugins|fft|qwt|ui_tmp|unit_test|pythonqt" + ignore-format: "build|plugins|fft|qwt|ui_tmp|unit_test|pythonqt" thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} - name: Failure if: steps.linter.outputs.checks-failed > 0 diff --git a/src/data_source.cpp b/src/data_source.cpp index 989197b..8f3de0a 100644 --- a/src/data_source.cpp +++ b/src/data_source.cpp @@ -8,7 +8,7 @@ DataSource::DataSource(QString lbl) : label(lbl) { - // TODO + // TODO - anything to do here? } From da89e232d70aff9cb43e0aeed8728f2a7e34d14a Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 5 Dec 2024 12:44:43 +1100 Subject: [PATCH 4/8] Fix file --- .github/workflows/lint.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 64b9930..0dccd9c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -2,7 +2,6 @@ name: Code Style -on: on: pull_request: branches: [main, master] From b18b5c3a2788fc53032b831a7996382f580ba6ef Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 5 Dec 2024 12:45:08 +1100 Subject: [PATCH 5/8] Always run CI step --- .github/workflows/lint.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 0dccd9c..f7f5fd0 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -3,13 +3,12 @@ name: Code Style on: - pull_request: - branches: [main, master] - paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '*.pro'] push: - branches: [main, master] - paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '*.pro'] - + branches: + - master + pull_request: + branches: + - master jobs: clang-tidy: From d7418cc0073a6d8414ad3568922fb2afb1430d55 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 5 Dec 2024 13:12:30 +1100 Subject: [PATCH 6/8] Updates --- .clang-tidy | 3 +++ .github/workflows/lint.yaml | 1 + src/data_source.cpp | 9 ++++----- 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..db1ea30 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,3 @@ +--- +Checks: + - '-modernize-use-trailing-return-type' \ No newline at end of file diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index f7f5fd0..8abbb4b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -23,6 +23,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + tidy-checks: '' # Refer to .clang-tidy file for checks ignore: "build|plugins|fft|qwt|ui_tmp|unit_test|pythonqt" ignore-format: "build|plugins|fft|qwt|ui_tmp|unit_test|pythonqt" thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} diff --git a/src/data_source.cpp b/src/data_source.cpp index 8f3de0a..1cd9352 100644 --- a/src/data_source.cpp +++ b/src/data_source.cpp @@ -1,12 +1,11 @@ -#include -#include -#include +#include +#include +#include #include "data_source.hpp" -DataSource::DataSource(QString lbl) : - label(lbl) +DataSource::DataSource(QString lbl) : label(lbl) { // TODO - anything to do here? } From 6b614fc1b05a95f7e276bda0c76c03e8d7d0b795 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 5 Dec 2024 13:53:29 +1100 Subject: [PATCH 7/8] Update .clang-tidy --- .clang-tidy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.clang-tidy b/.clang-tidy index db1ea30..50e58ff 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,5 @@ --- Checks: + - '*' # Enable all checks + - '-clang-diagnostic-error' - '-modernize-use-trailing-return-type' \ No newline at end of file From b6cc75fcda1943e007b9388f6c697037f951e3e8 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 5 Dec 2024 15:13:08 +1100 Subject: [PATCH 8/8] Rename file --- .github/workflows/{lint.yaml => ci.yaml} | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) rename .github/workflows/{lint.yaml => ci.yaml} (73%) diff --git a/.github/workflows/lint.yaml b/.github/workflows/ci.yaml similarity index 73% rename from .github/workflows/lint.yaml rename to .github/workflows/ci.yaml index 8abbb4b..9ceea04 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,6 @@ # Run code style tests -name: Code Style +name: Code Checks on: push: @@ -11,13 +11,24 @@ on: - master jobs: - clang-tidy: + checks: runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + version: 5.13.2 + - name: Build qwt + run: | + cd qwt + qmake qwt.pro + make - uses: cpp-linter/cpp-linter-action@v2 id: linter env: