Skip to content

Configure clang-tidy static analysis in CMake#1190

Open
KvanTTT wants to merge 2 commits into
lightvector:masterfrom
KvanTTT:clang-tidy-analyser
Open

Configure clang-tidy static analysis in CMake#1190
KvanTTT wants to merge 2 commits into
lightvector:masterfrom
KvanTTT:clang-tidy-analyser

Conversation

@KvanTTT

@KvanTTT KvanTTT commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Enable already applied checks (from #1167)

KvanTTT added 2 commits April 25, 2026 15:05
- Install `clang-tidy` as a dependency across all platforms.
- Enable `USE_CLANG_TIDY` option in CMake configurations.
@KvanTTT

KvanTTT commented Apr 25, 2026

Copy link
Copy Markdown
Contributor Author

For some reason, the warnings are not being reported by MSVC compiler (but it works locally), but they are being reported on macOS and Linux: https://github.com/lightvector/KataGo/actions/runs/24933559965/job/73015201820?pr=1190

I recommend fixing/suppressing remaining and new warnings (for instance, introduced by ed71a1f)

Comment thread cpp/CMakeLists.txt Outdated
endif()

set_target_properties(katago PROPERTIES
CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=-*,performance-inefficient-vector-operation,performance-unnecessary-copy-initialization,readability-non-const-parameter,readability-make-member-function-const;${CLANG_TIDY_EXTRA_ARGS}")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably could enable all performance-related lints:

performance-*

But it provokes too many warnings and most of them aren't valuable.

@KvanTTT
KvanTTT force-pushed the clang-tidy-analyser branch from 2bb87d0 to c09446b Compare July 26, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant