Fixes for clang-tidy-review

This commit is contained in:
Dan Paulat 2024-11-28 06:52:41 -06:00
parent d539f7723e
commit ed9e7ad72f
3 changed files with 51 additions and 14 deletions

View file

@ -3,7 +3,10 @@ Checks:
- 'bugprone-*' - 'bugprone-*'
- 'clang-analyzer-*' - 'clang-analyzer-*'
- 'cppcoreguidelines-*' - 'cppcoreguidelines-*'
- 'misc-*','modernize-*' - 'misc-*'
- 'modernize-*'
- 'performance-*' - 'performance-*'
- '-misc-include-cleaner' - '-misc-include-cleaner'
- '-misc-non-private-member-variables-in-classes'
- '-modernize-use-trailing-return-type'
FormatStyle: 'file' FormatStyle: 'file'

View file

@ -15,28 +15,42 @@ jobs:
strategy: strategy:
matrix: matrix:
include: include:
- name: linux64_clang - name: linux64_clang-tidy
os: ubuntu-24.04 os: ubuntu-24.04
build_type: Release build_type: Release
env_cc: clang-17
env_cxx: clang++-17
qt_version: 6.8.0 qt_version: 6.8.0
qt_arch_aqt: linux_gcc_64 qt_arch_aqt: linux_gcc_64
qt_modules: qtimageformats qtmultimedia qtpositioning qtserialport qt_modules: qtimageformats qtmultimedia qtpositioning qtserialport
qt_tools: '' qt_tools: ''
conan_arch: x86_64 conan_arch: x86_64
conan_compiler: gcc conan_compiler: clang
conan_compiler_version: 14 conan_compiler_version: 17
conan_compiler_libcxx: --settings compiler.libcxx=libstdc++ conan_compiler_libcxx: --settings compiler.libcxx=libstdc++11
conan_compiler_runtime: '' conan_compiler_runtime: ''
conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True
compiler_packages: clang-17 compiler_packages: clang-17 clang-tidy-17
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.env_cc }}
CXX: ${{ matrix.env_cxx }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
path: source
submodules: recursive submodules: recursive
- name: Checkout clang-tidy-review Repository
uses: actions/checkout@v4
with:
repository: ZedThree/clang-tidy-review
ref: v0.20.1
path: clang-tidy-review
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v3 uses: jurplel/install-qt-action@v3
with: with:
@ -59,13 +73,14 @@ jobs:
run: | run: |
pip install geopandas ` pip install geopandas `
GitPython GitPython
pip install --break-system-packages clang-tidy-review/post/clang_tidy_review
- name: Install Conan Packages - name: Install Conan Packages
shell: pwsh shell: pwsh
run: | run: |
pip install "conan<2.0" pip install "conan<2.0"
conan profile new default --detect conan profile new default --detect
conan install ./ ` conan install ./source/ `
--remote conancenter ` --remote conancenter `
--build missing ` --build missing `
--settings arch=${{ matrix.conan_arch }} ` --settings arch=${{ matrix.conan_arch }} `
@ -81,7 +96,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake ../ ` cmake ../source/ `
-G Ninja ` -G Ninja `
-DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" ` -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" `
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/supercell-wx" ` -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/supercell-wx" `
@ -91,13 +106,31 @@ jobs:
scwx-qt_update_radar_sites ` scwx-qt_update_radar_sites `
scwx-qt_autogen scwx-qt_autogen
- name: Review - name: Code Review
id: review id: review
uses: ZedThree/clang-tidy-review@v0.14.0 shell: bash
with: run: |
config_file: .clang-tidy cd source
build_dir: build review --clang_tidy_binary=clang-tidy-17 \
lgtm_comment_body: '' --token=${{ github.token }} \
--repo='${{ github.repository }}' \
--pr='${{ github.event.pull_request.number }}' \
--build_dir='../build' \
--base_dir='${{ github.workspace }}/source' \
--clang_tidy_checks='' \
--config_file='.clang-tidy' \
--include='*.[ch],*.[ch]xx,*.[ch]pp,*.[ch]++,*.cc,*.hh' \
--exclude='' \
--apt-packages='' \
--cmake-command='' \
--max-comments=25 \
--lgtm-comment-body='' \
--split_workflow=false \
--annotations=false \
--parallel=0
rsync -avzh --ignore-missing-args clang-tidy-review-output.json ../
rsync -avzh --ignore-missing-args clang-tidy-review-metadata.json ../
rsync -avzh --ignore-missing-args clang_fixes.json ../
- name: Upload Review - name: Upload Review
uses: ZedThree/clang-tidy-review/upload@v0.20.1 uses: ZedThree/clang-tidy-review/upload@v0.20.1

View file

@ -510,6 +510,7 @@ source_group("I18N Files" FILES ${TS_FILES})
add_library(scwx-qt OBJECT ${PROJECT_SOURCES}) add_library(scwx-qt OBJECT ${PROJECT_SOURCES})
set_property(TARGET scwx-qt PROPERTY AUTOMOC ON) set_property(TARGET scwx-qt PROPERTY AUTOMOC ON)
set_property(TARGET scwx-qt PROPERTY AUTOGEN_ORIGIN_DEPENDS OFF)
add_custom_command(OUTPUT ${COUNTIES_SQLITE_DB} add_custom_command(OUTPUT ${COUNTIES_SQLITE_DB}
COMMAND ${Python_EXECUTABLE} COMMAND ${Python_EXECUTABLE}