[hooks][fix]: 补全 workflow-check 检查并修正 AssetBundle 拼写

- 增加 UTF-8 输出编码设置
- 增加 Unity Assets/ 路径中文检查
- 增加未跟踪 Markdown 专项提示
- 修正 AssestBundle -> AssetBundle 拼写
- 细化 commit-module-mappings 中 entity/event/scene/network/skill/pool/ui/resource 映射

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
lms
2026-07-15 14:39:51 +08:00
parent 45046d8d96
commit bdadfd5759
5 changed files with 57 additions and 4 deletions

View File

@@ -4,6 +4,9 @@ param(
[string]$RepositoryRoot = ''
)
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.Encoding]::UTF8
$ErrorActionPreference = 'Stop'
if ([string]::IsNullOrWhiteSpace($RepositoryRoot)) {

View File

@@ -22,13 +22,23 @@
{ "pattern": "^README\\.md$", "module": "docs" },
{ "pattern": "^Assets/StrayFog/Editor/CopyToX/CopyToHF/(AssetBundle|SpriteAtlas)/", "module": "resource" },
{ "pattern": "^Assets/StrayFog/Core/SFSubPackageV2\\.cs$|^Assets/StrayFog/Editor/Tools/AssestBundle/", "module": "resource" },
{ "pattern": "^Assets/StrayFog/Core/SFSubPackageV2\\.cs$|^Assets/StrayFog/Editor/Tools/AssetBundle/", "module": "resource" },
{ "pattern": "^Assets/StrayFog/Editor/CopyToX/CopyToHF/UIWindowMgr/", "module": "ui" },
{ "pattern": "^Assets/StrayFog/Editor/", "module": "editor" },
{ "pattern": "^Assets/StrayFog/Core/", "module": "framework" },
{ "pattern": "^Assets/Editor/Command/", "module": "mcp" },
{ "pattern": "^Assets/Game/GameHFScripte/GameFunction/HFDownLoadSubPackage/|^Assets/Game/GameMono/Scripts/GameDllManager\\.cs$", "module": "resource" },
{ "pattern": "^Assets/Game/GameHFScripte/GameFunction/GameEntity/", "module": "entity" },
{ "pattern": "^Assets/Game/GameHFScripte/GameFunction/Event/", "module": "event" },
{ "pattern": "^Assets/Game/GameHFScripte/GameFunction/SceneManager/", "module": "scene" },
{ "pattern": "^Assets/Game/GameHFScripte/GameFunction/WebSocket/", "module": "network" },
{ "pattern": "^Assets/Game/GameHFScripte/GameFunction/Skill/", "module": "skill" },
{ "pattern": "^Assets/Game/GameHFScripte/GameFunction/UIWindows/|^Assets/Game/GameMono/Scripts/UIMono/", "module": "ui" },
{ "pattern": "^Assets/Game/GameHFScripte/CopyToHF/Network/", "module": "network" },
{ "pattern": "^Assets/Game/GameHFScripte/CopyToHF/MemoryManager/", "module": "pool" },
{ "pattern": "^Assets/Game/GameHFScripte/CopyToHF/Event/", "module": "event" },
{ "pattern": "^Assets/Game/GameHFScripte/CopyToHF/UIWindowMgr/", "module": "ui" },
{ "pattern": "^Assets/Game/GameHFScripte/CopyToHF/AssetBundle/", "module": "resource" },
{ "pattern": "^Assets/Game/GameHFScripte/", "module": "gamehf" },
{ "pattern": "^Assets/Game/GameGeneralScripte/", "module": "general" },
{ "pattern": "^Assets/Game/GameMono/", "module": "mono" },

View File

@@ -3,6 +3,9 @@ param(
[string]$DocsRoot = ''
)
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.Encoding]::UTF8
$ErrorActionPreference = 'Stop'
function Get-FullPath {
@@ -126,6 +129,41 @@ function Show-Changes {
}
}
function Show-ChinesePathWarnings {
param([object[]]$Changes)
$chineseRegex = New-Object System.Text.RegularExpressions.Regex '\p{IsCJKUnifiedIdeographs}', ([System.Text.RegularExpressions.RegexOptions]::CultureInvariant)
$offenders = @($Changes | Where-Object {
$_.Path -like 'Assets/*' -and $chineseRegex.IsMatch($_.Path)
})
Write-Output ''
Write-Output '[Chinese path check]'
if ($offenders.Count -eq 0) {
Write-Output ' No Chinese characters found in Unity project paths.'
}
else {
foreach ($change in $offenders) {
Write-Warning ("Chinese characters in Unity path: {0}" -f $change.Path)
}
}
}
function Show-UntrackedMarkdownHint {
param([object[]]$Changes)
$untrackedMarkdown = @($Changes | Where-Object {
$_.Status -match '^\?\?$' -and $_.Path -like '*.md'
})
if ($untrackedMarkdown.Count -gt 0) {
Write-Output ''
Write-Output '[Untracked Markdown hint]'
Write-Output ' The following Markdown files are untracked. If they are long-term knowledge, remember to update modules/模块索引.md.'
foreach ($change in $untrackedMarkdown) {
Write-Output (" - {0}" -f $change.Path)
}
}
}
function Get-MarkdownLinkFailures {
param([string]$DocumentationRoot, [object[]]$Changes)
@@ -190,7 +228,7 @@ if (-not [string]::IsNullOrWhiteSpace($unityGitRoot)) {
$unityChanges = @(Get-GitChanges $unityGitRoot (Split-Path -Leaf $resolvedUnityRoot))
}
Write-Output '[workflow-check] Read-only StrayFog workflow check'
Write-Output '[workflow-check] Read-only UnityAI workflow check'
Write-Output ("Documentation repository: {0}" -f $DocsRoot)
if ($resolvedUnityRoot) {
Write-Output ("Unity project: {0}" -f $resolvedUnityRoot)
@@ -207,6 +245,8 @@ else {
Show-Changes 'UnityAI changes' $docsChanges
Show-Changes 'Unity project changes' $unityChanges
Show-ChinesePathWarnings ($docsChanges + $unityChanges)
Show-UntrackedMarkdownHint $docsChanges
$unityPaths = @($unityChanges | ForEach-Object { $_.Path })
$copyRelationships = @(

View File

@@ -6,7 +6,7 @@
"verification": "执行 CopyToX检查 HF 生成差异,构建 GameHF并验证 Unity Console。"
},
{
"pattern": "^Assets/StrayFog/Core/SFSubPackageV2\\.cs$|^Assets/StrayFog/Editor/Tools/AssestBundle/",
"pattern": "^Assets/StrayFog/Core/SFSubPackageV2\\.cs$|^Assets/StrayFog/Editor/Tools/AssetBundle/",
"document": "modules/frameworks/资源管理/README.md",
"verification": "构建 StrayFogCore 或 SFEditor并验证 V2 清单、MD5、状态和目标平台下载。"
},

View File

@@ -11,7 +11,7 @@
| ESF AssetBundle 源码 | `Assets/StrayFog/Editor/CopyToX/CopyToHF/AssetBundle/` | 框架修改源头 |
| HF AssetBundle 代码 | `Assets/Game/GameHFScripte/CopyToHF/AssetBundle/` | CopyToX 生成,禁止手改 |
| V2 公共运行时 | `Assets/StrayFog/Core/SFSubPackageV2.cs` | 非热更层与热更层共享下载状态 |
| V2 编辑器构建 | `Assets/StrayFog/Editor/Tools/AssestBundle/` | 包配置、校验、清单和枚举生成 |
| V2 编辑器构建 | `Assets/StrayFog/Editor/Tools/AssetBundle/` | 包配置、校验、清单和枚举生成 |
| 热更业务门面 | `Assets/Game/GameHFScripte/GameFunction/HFDownLoadSubPackage/` | 普通资源下载 API |
| 启动代码入口 | `Assets/Game/GameMono/Scripts/GameDllManager.cs` | Bootstrap 校验、下载和加载 |