check-links accepts --stale-days=N and then ignores it (365 is used)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, node.js
调研方向
阅读site/check-links.mjs第99–105行附近和site/lib/link-check.mjs第54–63行附近的内容,然后追踪已解析的标志如何传递到staleDaysFrom。针对--stale-days=30和--stale-days 30两种形式,以及一个无效值,运行相关测试。完成标准是两种有效形式都使用30天的截止期限,而无效值仍会报错。
由索引模型根据 Issue 内容生成。
描述
Summary
check-links parses argv twice: the strict cliArgs parse accepts --stale-days=30, then staleDaysFrom(process.argv) scans for the exact token --stale-days, misses the = form and falls back to 365 days without a warning.
Where
site/check-links.mjs:99-105site/lib/link-check.mjs:54-63(staleDaysFrom)
Details
readArgs returns { "stale-days": "30" } while staleDaysFrom(['node','x','--stale-days=30']) returns { days: 365 }. This is the last script that still hand-parses argv after the strict-flags change.
Impact
A maintainer asking for a shorter staleness window locally silently gets the 365-day report. The weekly workflow passes no flag, so CI is unaffected.
Steps to reproduce
node site/check-links.mjs --stale-days=30 --report r.md- The stale list uses a 365-day cutoff.
Suggested fix
Validate the parsed value (flags["stale-days"]) in staleDaysFrom instead of re-reading process.argv, and drop the second parse.
Acceptance criteria
-
--stale-days=30and--stale-days 30both give a 30-day cutoff - Invalid values still fail as they do today
Getting started
- Relevant files:
site/check-links.mjs,site/lib/link-check.mjs - Run the tests:
npm test; the full local gate isnpm run check(Node 22+, no install step) - Related docs:
CONTRIBUTING.md,site/README.md
Related: #82
Filed by repo-audit/full-audit at 4adb944. Severity: low. Effort: S. audit-key: bug|site/check-links.mjs|staleDaysFrom
- 主要语言
- JavaScript
- 星标
- 58
- 派生
- 15
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 12
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TMHSDigital/Free-Game-Dev-Assets 的其他 Issue
-
enhancement good first issue priority: medium
难度 2/5 1-3 小时 新手友好度 82/100
TMHSDigital/Free-Game-Dev-Assets#272 ·
维护者通常 1 天内回复
-
documentation good first issue priority: low
难度 2/5 1-3 小时 新手友好度 78/100
TMHSDigital/Free-Game-Dev-Assets#270 ·
维护者通常 1 天内回复
-
documentation priority: medium
难度 2/5 1-3 小时 新手友好度 82/100
TMHSDigital/Free-Game-Dev-Assets#269 ·
维护者通常 1 天内回复
-
good first issue priority: low tests
难度 2/5 1-3 小时 新手友好度 88/100
TMHSDigital/Free-Game-Dev-Assets#267 ·
维护者通常 1 天内回复
-
good first issue priority: low tests
难度 2/5 1-3 小时 新手友好度 83/100
TMHSDigital/Free-Game-Dev-Assets#266 ·
维护者通常 1 天内回复
查看 TMHSDigital/Free-Game-Dev-Assets 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
microsoft/TypeScript#65370 ·
维护者通常 1 天内回复
-
metrics priority: medium
难度 1/5 1-3 小时 新手友好度 86/100
LearningCircuit/local-deep-research#8336 ·
维护者通常 1 天内回复
-
ace bug yaml
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
svelte: whitespace-only edit leaves an empty todo, edits not trimmed, filter not restored on reload未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
agentic-workflows
难度 1/5 1 小时以内 新手友好度 85/100
githubnext/gh-cao#20316 ·
维护者通常 1 天内回复