Skip to content

armgit / Piik

Public Imported from GitHub
0

Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。

chore: stop rejecting untracked worktree files (#123)

AAA18263804b988
diff --git a/docs/maintenance.md b/docs/maintenance.md
index bd4c7f01..87d52923 100644
--- a/docs/maintenance.md
+++ b/docs/maintenance.md
@@ -102,7 +102,7 @@
## 自动化
-- `.githooks/pre-commit` 和 CI 调用 `scripts/check-project-state.sh`;原生 Windows 可运行等价的 `scripts/check-project-state.ps1`。两份入口共享 `scripts/required-project-paths.txt`,检查 whitespace、必需文件、Git 跟踪状态和上下文文件上限。
+- `.githooks/pre-commit` 和 CI 调用 `scripts/check-project-state.sh`;原生 Windows 可运行等价的 `scripts/check-project-state.ps1`。两份入口共享 `scripts/required-project-paths.txt`,检查 whitespace、清单内必需文件的 Git 跟踪状态和上下文文件上限。
- `.github/workflows/repository-hygiene.yml` 在 push/PR 上运行 tracked POSIX 入口。
- hook 只做快速、确定、可复现的检查;需要工程判断的内容留给评审和测试。
- 新脚本必须有明确当前用途、跨平台入口、失败信息和 CI 调用方。没有现实使用者的 hook 或框架不进入仓库。
diff --git a/scripts/check-project-state.ps1 b/scripts/check-project-state.ps1
index 05320536..d22ec358 100644
--- a/scripts/check-project-state.ps1
+++ b/scripts/check-project-state.ps1
@@ -16,12 +16,6 @@ foreach ($path in $requiredPaths) {
}
}
-$untracked = @(git ls-files --others --exclude-standard)
-if ($untracked.Count -gt 0 -and $env:SCREENER_ALLOW_UNTRACKED -ne "1") {
- Write-Error "Untracked project files found. Track or ignore them intentionally:`n$($untracked -join "`n")"
- throw "Set SCREENER_ALLOW_UNTRACKED=1 only for an intentional partial commit."
-}
-
$agentLines = @(Get-Content -Encoding UTF8 AGENTS.md).Count
$memoryLines = @(Get-Content -Encoding UTF8 docs/project-memory.md).Count
$memoryBytes = (Get-Item docs/project-memory.md).Length
diff --git a/scripts/check-project-state.sh b/scripts/check-project-state.sh
index 44155f25..853d4c56 100755
--- a/scripts/check-project-state.sh
+++ b/scripts/check-project-state.sh
@@ -12,14 +12,6 @@ while IFS= read -r path || [ -n "$path" ]; do
fi
done < scripts/required-project-paths.txt
-untracked=$(git ls-files --others --exclude-standard)
-if [ -n "$untracked" ] && [ "${SCREENER_ALLOW_UNTRACKED:-0}" != "1" ]; then
- echo "Untracked project files found. Track or ignore them intentionally:" >&2
- printf '%s\n' "$untracked" >&2
- echo "Set SCREENER_ALLOW_UNTRACKED=1 only for an intentional partial commit." >&2
- exit 1
-fi
-
agent_lines=$(wc -l < AGENTS.md | tr -d '[:space:]')
memory_lines=$(wc -l < docs/project-memory.md | tr -d '[:space:]')
memory_bytes=$(wc -c < docs/project-memory.md | tr -d '[:space:]')