-
Notifications
You must be signed in to change notification settings - Fork 58
Migrate to use clang-tidy v22 #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,12 +76,12 @@ runs: | |
| if: ${{ inputs.workflow == 'lint' }} | ||
| shell: bash | ||
| run: | | ||
| # Install clang-tidy-21 from LLVM repository for full C++23 support | ||
| # Install clang-tidy-22 from LLVM repository for full C++23 support | ||
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc | ||
| echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list | ||
| echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" | sudo tee /etc/apt/sources.list.d/llvm.list | ||
| sudo apt-get -qqy update | ||
| sudo apt-get -qy install clang-tidy-21 | ||
| sudo ln -fs "$(which clang-tidy-21)" "/usr/local/bin/clang-tidy" | ||
| sudo apt-get -qy install clang-tidy-22 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Upgrade to clang-tidy 22 for Linux. |
||
| sudo ln -fs "$(which clang-tidy-22)" "/usr/local/bin/clang-tidy" | ||
|
|
||
| - name: Install and configure gcc-14 | ||
| shell: bash | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,17 +24,17 @@ runs: | |
| # This has been replaced by the 'install qt' section below to manage | ||
| # qt6 versioning independently from the OS. | ||
| # brew install llvm@21 qt6 | ||
| brew install llvm@21 | ||
| brew install llvm@22 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Upgrade to clang-tidy 22 for macos. |
||
| # The macos-26 runner ships with Homebrew llvm@20 linked into | ||
| # /usr/local/bin/ (clang, clang++, clang-format, clang-tidy, etc.). | ||
| # Use -sf to overwrite the existing clang-tidy with our llvm@21 | ||
| # Use -sf to overwrite the existing clang-tidy with our llvm@22 | ||
| # version, and remove clang/clang++ so that ccache-action | ||
| # (create-symlink: true) can create its own symlinks. | ||
| # clang-format is installed separately via pip (see below) so that | ||
| # both CI platforms use the version pinned by | ||
| # CLANG_FORMAT_CI_VERSION in the Makefile. | ||
| # Ref: https://github.com/actions/runner-images/blob/main/images/macos/macos-26-Readme.md | ||
| ln -sf "$(brew --prefix llvm@21)/bin/clang-tidy" "/usr/local/bin/clang-tidy" | ||
| ln -sf "$(brew --prefix llvm@22)/bin/clang-tidy" "/usr/local/bin/clang-tidy" | ||
| rm -f /usr/local/bin/clang /usr/local/bin/clang++ /usr/local/bin/clang-format | ||
|
|
||
| - name: install qt | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,15 @@ find_program( | |
| ) | ||
| if(USE_CLANG_TIDY) | ||
| if(CLANG_TIDY_EXE) | ||
| set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-header-filter=/cpp/.\*/modmesh/.\*" "--extra-arg=-std=c++2b") | ||
| set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" | ||
| "-header-filter=/cpp/.\*" | ||
| "--extra-arg=-std=c++23" | ||
| # FIXME: Remove --allow-no-checks in the future after figuring out | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is strange to have the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are using |
||
| # why the error message "Error: no checks enabled." appears with | ||
| # some files, after upgrading to clang-tidy-22. | ||
| # Related information (but not what we see in modmesh): | ||
| # https://github.com/llvm/llvm-project/issues/192713 | ||
| "--allow-no-checks") | ||
| if(LINT_AS_ERRORS) | ||
| set(DO_CLANG_TIDY "${DO_CLANG_TIDY}" "-warnings-as-errors=*") | ||
| endif() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,6 +175,7 @@ else () # MSVC | |
| ${COMMON_COMPILER_OPTIONS} | ||
| -Wno-unused-value # for PYBIND11_EXPAND_SIDE_EFFECTS in pybind11.h | ||
| -Wno-noexcept-type # GCC | ||
| -Wno-elaborated-enum-base # for apple accelerate/veclib | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to piggyback for another enhancement I am doing. |
||
| ) | ||
| endif () # MSVC | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it multiple lines and skip all of
clang-analyzer-*.