-
Notifications
You must be signed in to change notification settings - Fork 117
clang-tidy #1580
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
clang-tidy #1580
Conversation
…ysis - Add comprehensive .clang-tidy configuration tailored for legacy C++98/C++20 hybrid codebase - Add Python helper script for running clang-tidy with project-specific filtering - Update TESTING.md with clang-tidy usage documentation and examples - Support MinGW-w64 cross-compilation environment and ReactOS ATL compatibility - CMAKE_EXPORT_COMPILE_COMMANDS already enabled in existing presets
Add Windows Command Prompt and PowerShell alternatives to the existing Unix/Linux find command for running clang-tidy on multiple files. The Python helper script already supports all platforms.
OmniBlade
left a comment
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.
I get nothing but errors when I point it at a successful build directory of the following kind when I run your powershell. Your python only works for small sets of files on windows and generates errors in a similar manner though they are hidden from view:
error: PCH file 'C:/Code/CnC_Generals_Zero_Hour/build/custom/Generals/Code/GameEngine/CMakeFiles/g_gameengine.dir/Debug/cmake_pch.cxx.pch' not found: module file not found [clang-diagnostic-error]
|
|
||
| def find_project_root() -> Path: | ||
| """Find the project root directory by looking for CMakeLists.txt.""" | ||
| current = Path(__file__).parent |
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.
My testing has failed here where the path passed to python is relative. Changing this line to current = Path(__file__).parent.resolve() to ensure its working on the fully qualified path solved this for me.
| # For now, run sequentially | ||
| print(f"Note: Parallel execution with {jobs} jobs not implemented yet.") | ||
|
|
||
| result = subprocess.run(cmd, cwd=find_project_root()) |
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.
This fails to run on windows for me for the whole set of files, I suspect the command line it generates is too long for cmd to handle, though it also fails in gitbash.
| HeaderFilterRegex: '(Core|Generals|GeneralsMD|Dependencies)/.*\.(h|hpp)$' | ||
|
|
||
| # Analysis options | ||
| AnalyzeTemporaryDtors: false |
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.
LLVM 19 I have installed locally does not like this option, I suspect older versions from stable Linux OS distributions will like it even less?
|
Replaced by #1807. Thanks. |
Draft script for clang-tidy.