diff --git a/hooks/commit-check.ps1 b/hooks/commit-check.ps1 index 35a4f00..df93398 100644 --- a/hooks/commit-check.ps1 +++ b/hooks/commit-check.ps1 @@ -4,6 +4,9 @@ param( [string]$RepositoryRoot = '' ) +[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +$OutputEncoding = [System.Text.Encoding]::UTF8 + $ErrorActionPreference = 'Stop' if ([string]::IsNullOrWhiteSpace($RepositoryRoot)) { diff --git a/hooks/commit-module-mappings.json b/hooks/commit-module-mappings.json index 4d03db3..54d17e1 100644 --- a/hooks/commit-module-mappings.json +++ b/hooks/commit-module-mappings.json @@ -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" }, diff --git a/hooks/workflow-check.ps1 b/hooks/workflow-check.ps1 index 6b41598..67a2d95 100644 --- a/hooks/workflow-check.ps1 +++ b/hooks/workflow-check.ps1 @@ -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 = @( diff --git a/hooks/workflow-path-mappings.json b/hooks/workflow-path-mappings.json index fafd9c4..1dc5731 100644 --- a/hooks/workflow-path-mappings.json +++ b/hooks/workflow-path-mappings.json @@ -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、状态和目标平台下载。" }, diff --git a/modules/frameworks/资源管理/README.md b/modules/frameworks/资源管理/README.md index 1c0b13a..0fa9fee 100644 --- a/modules/frameworks/资源管理/README.md +++ b/modules/frameworks/资源管理/README.md @@ -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 校验、下载和加载 |