[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

@@ -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 = @(