clang-tidy at zero warnings, no C-style casts, Windows compile databases #3
No assignees
Labels
No labels
area/build
area/content
area/editor
area/engine
area/graphics
area/platform
area/repo-wide
area/tests
area/tools
bug
optional
roadmap
size/L
size/M
size/S
No project
No milestone
Blocks
Depends on
#7 CI on Forgejo Actions for Linux and Windows
UnflavoredMeson/Primal_Plus_Plus
#2 CMake build for Linux next to MSBuild, warnings as errors, pinned downloads
UnflavoredMeson/Primal_Plus_Plus
Reference
No Branch/Tag specified
Notifications
1 participant
Due date
No due date set.
Reference
UnflavoredMeson/Primal_Plus_Plus#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Lint at zero from the start costs a little every day; lint turned on later cost the fork a repo-wide cast pass and a long tail of fixes. Windows-only code (D3D12, Win32) can't be checked by the Linux build, so it needs its own compile database.
Decided
.clang-tidy, kept at 0 warnings.modernize-avoid-c-style-castis on;modernize-use-autois off (we write the type unless it's obvious).static_cast/reinterpret_cast/const_cast/std::bit_cast;std::to_underlying(e)for enums. clang-tidy doesn't seeextern "C"functions, macro arguments or disabled#ifbranches: those are watched by hand.Tools/WindowsCompileDb/gen_windb.py(/std:c++23previewfor clang-cl 23), run with-checks=-readability-duplicate-include..idea/(profile, the "Primal sources" scope, the project dictionary); the rest of.idea/is ignored.Read first
.clang-format/.clang-tidy".Steps
.clang-tidyand run it overEngine/on Linux. Read the first 20 findings before fixing any, to see what kinds there are..git-blame-ignore-revs.Tools/WindowsCompileDb/(the fork's README explains the Windows SDK and MSVC headers it needs) and run clang-tidy over the D3D12 and Win32 files..idea/files and the.gitignorerule that tracks only those.tidystep to a script you can run before every push (CI runs it from S0-07).Done when
Engine/,EngineTest/,EngineDLL/orContentTools/.Claude can help with
Learn
static_castandreinterpret_cast, and whenstd::bit_castis the right one.