mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 00:39:00 +08:00
- 优化 GodotYamlConfigEnvironment 目录枚举逻辑,拆分 helper 以消除 MA0051 - 修复 Godot 生命周期 await 的上下文声明,显式保留主线程同步上下文 - 更新 Godot.Tests 异步断言与字符串 comparer,用例项目构建收敛到 0 warning(s) - 补充 analyzer-warning-reduction 跟踪与 trace,记录 RP-053 的批次结果与验证
10 KiB
10 KiB
Analyzer Warning Reduction 追踪
Analyzer Warning Reduction 追踪
2026-04-24 — RP-053
阶段:GFramework.Godot / GFramework.Godot.Tests 小批次 warning 清理
- 触发背景:
- 用户以
$gframework-batch-boot 75要求继续按批次推进 analyzer warning reduction,并以origin/main作为累计分支 diff 基线 - 当前 worktree
fix/analyzer-warning-reduction-batch相对origin/main的已提交分支 diff 为0个文件,具备继续落一个低风险 warning batch 的空间 - solution-level
dotnet clean GFramework.sln -c Release仍在ValidateSolutionConfiguration阶段失败,因此本轮继续用直接dotnet build GFramework.sln -c Release建立热点观察值
- 用户以
- 主线程实施:
- 运行
dotnet build GFramework.sln -c Release,确认当前整仓观测值为1122 warning(s),并从输出中挑选GFramework.Godot的小范围热点作为本轮批次 - 在
GodotYamlConfigEnvironment.cs中按“普通文件系统 / Godot 路径”拆分目录枚举 helper,消除MA0051 - 在
AbstractArchitecture.cs与SceneBehaviorBase.cs中将必须保留 Godot 主线程上下文的 await 显式改为.ConfigureAwait(true),清理MA0004并把线程意图写入注释 - 在
GFramework.Godot.Tests中补齐异步断言的.ConfigureAwait(false),并让RichTextMarkupTests的测试字典显式指定StringComparer.Ordinal
- 运行
- 验证里程碑:
dotnet clean GFramework.sln -c Release- 结果:失败;停在
ValidateSolutionConfiguration,0 Warning(s)、0 Error(s)
- 结果:失败;停在
dotnet build GFramework.sln -c Release- 结果:成功;
1122 Warning(s)、0 Error(s)
- 结果:成功;
dotnet build GFramework.Godot/GFramework.Godot.csproj -c Release- 第一轮修复后:成功;
12 Warning(s)、0 Error(s),仅剩MA0004 - 第二轮修复后:成功;
0 Warning(s)、0 Error(s)
- 第一轮修复后:成功;
dotnet test GFramework.Godot.Tests/GFramework.Godot.Tests.csproj -c Release --filter "FullyQualifiedName~AbstractArchitectureModuleInstallationTests|FullyQualifiedName~GodotYamlConfigLoaderTests|FullyQualifiedName~RichTextMarkupTests"- 结果:成功;
Passed: 15、Failed: 0
- 结果:成功;
dotnet build GFramework.Godot.Tests/GFramework.Godot.Tests.csproj -c Release- 并行验证时:成功;
1 Warning(s)、0 Error(s);MSB3026为与并行dotnet test竞争输出 DLL 的文件占用 - 串行复验:成功;
0 Warning(s)、0 Error(s)
- 并行验证时:成功;
- 当前结论:
GFramework.Godot与GFramework.Godot.Tests本轮直接涉及的 warning 已全部清零- 当前待提交代码批次相对
origin/main的源码 diff 为6个文件、107行,距离$gframework-batch-boot 75主停止阈值仍有充足余量 - 继续推进的下一批候选将主要落在
GFramework.Game等高 warning 基线模块,已不再属于当前同等级低风险切片,因此本轮在这里收口并进入提交
2026-04-24 — RP-052
阶段:PR review follow-up(comparer 契约 + ConfigureAwait(false) 收尾)
- 触发背景:
- 当前分支 PR #283 的最新 review 中,
greptile-apps[bot]仍有一个未解决线程,指出UnifiedSettingsDataRepository.CloneFilefallback 会静默丢失原 comparer - CodeRabbit 另指出
AutoRegisterExportedCollectionsGeneratorTests.cs中还残留 5 处await test.RunAsync();,与同项目其他测试文件的.ConfigureAwait(false)风格不一致
- 当前分支 PR #283 的最新 review 中,
- 主线程实施:
- 复核 PR review JSON、
UnifiedSettingsDataRepository.cs、UnifiedSettingsFile.cs与AutoRegisterExportedCollectionsGeneratorTests.cs的当前代码,确认只有 comparer 契约线程仍属最新 head 上的实质问题 - 将
UnifiedSettingsFile.Sections的 XML 注释补充为显式 comparer 契约,并把默认字典初始化改为StringComparer.Ordinal - 将
CloneFilefallback 从隐式默认 comparer 改为显式StringComparer.Ordinal,并同步修正文档注释,避免继续暗含“保留原语义”的错误表述 - 把
AutoRegisterExportedCollectionsGeneratorTests中剩余的 5 处await test.RunAsync();统一为.ConfigureAwait(false),同时让VerifyDiagnosticsAsync内部也消费ConfigureAwait(false)
- 复核 PR review JSON、
- 验证里程碑:
dotnet build GFramework.Game/GFramework.Game.csproj -c Release- 结果:成功;
533 Warning(s)、0 Error(s);GFramework.Game仍有既有 warning 基线,本轮 follow-up 仅处理 PR review 指向的 comparer 契约与测试异步等待一致性
- 结果:成功;
dotnet build GFramework.Godot.SourceGenerators.Tests/GFramework.Godot.SourceGenerators.Tests.csproj -c Release- 结果:成功;
0 Warning(s)、0 Error(s)
- 结果:成功;
dotnet test GFramework.Godot.SourceGenerators.Tests/GFramework.Godot.SourceGenerators.Tests.csproj -c Release --no-build- 首次并行复验:失败;
FileNotFoundException,原因是--no-build测试在 Release DLL 落盘前启动 - 串行复验:成功;
Passed: 48、Failed: 0
- 首次并行复验:失败;
- 当前结论:
- PR #283 当前仍打开的 comparer review thread 已在本地代码与 XML 注释层面得到对应修复
AutoRegisterExportedCollectionsGeneratorTests的异步等待风格已与同项目其他测试保持一致- 当前改动已通过直接受影响测试项目的 Release build 与串行 Release test 复验,可进入提交阶段
2026-04-24 — RP-051
阶段:GFramework.Godot.SourceGenerators.Tests warning 清零
- 触发背景:
- 用户要求直接运行
dotnet clean,不再添加额外 shell 包装;solution-leveldotnet clean仍然在ValidateSolutionConfiguration阶段失败 - 直接执行仓库根目录
dotnet build成功,并输出1184 warning(s),说明当前真实热点已从GFramework.Godot.SourceGenerators转移到对应测试项目
- 用户要求直接运行
- 主线程实施:
- 以
GFramework.Godot.SourceGenerators.Tests为独立批次,先确认该项目本地基线为24 warning(s) - 在
BindNodeSignalGeneratorTests.cs、AutoSceneGeneratorTests.cs、AutoUiPageGeneratorTests.cs、GetNodeGeneratorTests.cs、AutoRegisterExportedCollectionsGeneratorTests.cs、GodotProjectMetadataGeneratorTests.cs中抽取共享 source / diagnostic helper,压缩重复长方法 - 在
Core/GeneratorTest.cs中补充ConfigureAwait(false),清除项目内唯一MA0004 - 把
GFramework.Godot.SourceGenerators.Tests项目 warning 从24降到0
- 以
- 验证里程碑:
dotnet build- 结果:成功;
1184 Warning(s)、0 Error(s)
- 结果:成功;
dotnet build GFramework.Godot.SourceGenerators.Tests/GFramework.Godot.SourceGenerators.Tests.csproj- 初始结果:成功;
24 Warning(s)、0 Error(s) - 第一批(
BindNodeSignal+GeneratorTest)后:16 Warning(s) - 第二批(
AutoScene/AutoUiPage/GetNode)后:8 Warning(s) - 第三批(
Registration/Project)后:1 Warning(s) - 收尾修复后:成功;
0 Warning(s)、0 Error(s)
- 初始结果:成功;
dotnet build GFramework.Godot.SourceGenerators.Tests/GFramework.Godot.SourceGenerators.Tests.csproj -c Release- 结果:成功;
0 Warning(s)、0 Error(s)
- 结果:成功;
dotnet test GFramework.Godot.SourceGenerators.Tests/GFramework.Godot.SourceGenerators.Tests.csproj -c Release --no-build- 结果:成功;
Passed: 48、Failed: 0
- 结果:成功;
- 当前结论:
GFramework.Godot.SourceGenerators.Tests已在Debug/Release构建下达到0 warning(s)- 按
origin/mainmerge-base 计算并只纳入当前暂存批次时,累计分支 diff 为23个文件,低于$gframework-batch-boot 75的主停止阈值 - 仓库根目录
dotnet clean仍无法稳定产出新的 clean 基线,需要在下一轮单独排查 - 当前 worktree 已有与本批次无关的既有改动;提交时必须只暂存 analyzer warning reduction 相关文件
2026-04-24 — RP-050
阶段:clean-build 基线修正与 GFramework.Godot.SourceGenerators 切片清零
- 触发背景:
- 用户确认之前的
0 Warning(s)来自增量构建假阴性;只有先dotnet clean再dotnet build,warning 才会重新出现 - 用户给出 clean solution build 的真实结果:
Build succeeded with 1193 warning(s)
- 用户确认之前的
- 主线程实施:
- 纠正当前 topic 的 active todo / trace,把 clean build 作为新的 warning 检查真值
- 在
BindNodeSignalGenerator.cs、GetNodeGenerator.cs、GodotProjectMetadataGenerator.cs中完成分阶段方法抽取与字符串比较修正 - 在
Registration/AutoRegisterExportedCollectionsGenerator.cs中拆分TryCreateRegistration,清除最后一个MA0051 - 更新
AGENTS.md,明确 warning 检查必须先dotnet clean再dotnet build
- 验证里程碑:
dotnet clean GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj -c Release- 结果:成功;
0 Warning(s)、0 Error(s)
- 结果:成功;
dotnet build GFramework.Godot.SourceGenerators/GFramework.Godot.SourceGenerators.csproj -c Release- 首次验证:成功;
1 Warning(s),剩余Registration/AutoRegisterExportedCollectionsGenerator.cs(182,25)MA0051 - 修复后复验:成功;
0 Warning(s)、0 Error(s)
- 首次验证:成功;
- 当前结论:
GFramework.Godot.SourceGenerators已在 cleanReleasebuild 下从 9 个 warning 降到 0 个 warning- 整仓库 warning 基线仍以用户确认的 clean solution build
1193 warning(s)为准 - 下一轮应继续从 clean solution build 输出中选择新的低风险热点
Archive Context
- 当前轮次归档:
- 历史跟踪归档:
- 历史 trace 归档: