Skip to content

Refactor/graphic/file naming snake case - #78

Merged
CoraBlack merged 4 commits into
gkit-org:mainfrom
YuanSang0512:refactor/graphic/file-naming-snake-case
Aug 13, 2026
Merged

Refactor/graphic/file naming snake case#78
CoraBlack merged 4 commits into
gkit-org:mainfrom
YuanSang0512:refactor/graphic/file-naming-snake-case

Conversation

@YuanSang0512

Copy link
Copy Markdown
Contributor

PR: refactor(graphic): 文件名统一 snake_case + 注释统一 Doxygen 块风格

描述

概述

落地 CLAUDE.md 中约定的代码格式规范,包含两大部分:

  1. 文件命名统一为 snake_case:graphic 模块 39 个头文件/源文件从 PascalCase 批量重命名为 snake_caseRenderer.hpp → renderer.hpp 等),并同步更新 gkit.hpp、CMake 与引用处的 include。
  2. 注释统一为 /** */ Doxygen 块风格:math 模块约 540 处行首 /// 注释转换为 /** @brief ... */ 块;graphic 模块清理零星 ///,并把块注释内部的 tab 缩进归一化为空格(星号与 /** 的中间 * 对齐)。

另外新增 .gitignore 规则,忽略本地文档 CLAUDE.mddocs/(不随仓库提交)。

改动内容

1. 文件重命名 snake_caseinclude/gkit/graphic/src/graphic/,共 39 个文件)

  • render/Renderer.hpp/cppRenderDevice.hppRenderObject.hpp/cppRenderQueue.hpp/cppRenderCommand.hppRenderState.hpp
  • resource/Buffer.hppFrameBuffer.hpp/cppIndexBuffer.hpp/cppMaterial.hppRenderBuffer.hpp/cppShader.hpp/cppStorageBuffer.hppTexture.hpp/cppUniformBuffer.hppVertexArray.hpp/cppVertexBuffer.hpp/cppVertexBufferLayout.hpp
  • backend/opengl/Device.hpp/cppStateManager.hpp/cpp 等 17 个文件
  • 同步更新引用:gkit.hppsrc/graphic/CMakeLists.txtsrc/graphic/create_device.cpptest/graphic/test_render.cpp

2. 注释统一为 Doxygen 块风格include/gkit/math/ 8 个 + include/gkit/graphic/src/graphic/ 27 个)

  • math:color.hppconstants.hppmatrix3/4.hppscalar.hppvector2/3/4.hpp 中约 540 处 /// 转换为 /** @brief ... */ 块;6 处行尾 ; /// @brief 后置注释改为块上注释。

  • graphic:清理零星 ///,块注释内 tab 缩进统一为空格,对齐格式如下:

    /**
     * @brief ...
     */
    

3. .gitignore.gitignore

  • 新增 # local documentation (untracked) 段:忽略 CLAUDE.mddocs/

测试

  • 仅注释与文件重命名,无任何代码逻辑改动;gcc Debug preset 构建通过(gkit_graphic + test_render)。
  • 校验:math/graphic 无残留 ///;全部 414 个注释块星号对齐(* 列 = /** 缩进 + 1),0 个错位。

Commits

Commit 描述
0b0ed41 chore: ignore CLAUDE.md and docs/
11289e6 refactor(graphic): rename headers and sources to snake_case
ff626a1 refactor(graphic,math): unify comments to Doxygen block style

验证

  • cmake --preset x86_64-gcc-debug + cmake --build build/x86_64-gcc-debug 构建通过。
  • git diff 复核:graphic 改动仅含注释行,无代码变更混入。
  • 已知无关的预存问题(本 PR 之前就存在,未处理):test_log 挂起/崩溃、test_value 退出码 1。

Convert math module's line-leading /// comments to / ** * / blocks,
normalize graphic module's comment block indentation (star aligned one
column right of the opening /**), and fix stray /// comments to blocks.
No code changes.
@CoraBlack
CoraBlack merged commit 12eb0f3 into gkit-org:main Aug 13, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in libgkit-dev-record Aug 13, 2026
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.

2 participants