check-links accepts --stale-days=N and then ignores it (365 is used)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js
Hướng nghiên cứu
Đọc site/check-links.mjs quanh các dòng 99–105 và site/lib/link-check.mjs quanh các dòng 54–63, sau đó theo dõi cách các cờ đã được phân tích truyền đến staleDaysFrom. Chạy các bài kiểm thử liên quan cho cả --stale-days=30 và --stale-days 30, cùng với một giá trị không hợp lệ. Hoàn thành khi cả hai dạng hợp lệ đều dùng mốc giới hạn 30 ngày và các giá trị không hợp lệ vẫn bị lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 58
- Fork
- 15
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/Free-Game-Dev-Assets
-
enhancement good first issue priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TMHSDigital/Free-Game-Dev-Assets#272 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/Free-Game-Dev-Assets#270 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TMHSDigital/Free-Game-Dev-Assets#269 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue priority: low tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
TMHSDigital/Free-Game-Dev-Assets#267 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue priority: low tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
TMHSDigital/Free-Game-Dev-Assets#266 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TMHSDigital/Free-Game-Dev-Assets
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/TypeScript#65370 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
metrics priority: medium
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
LearningCircuit/local-deep-research#8336 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ace bug yaml
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
svelte: whitespace-only edit leaves an empty todo, edits not trimmed, filter not restored on reloadĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
agentic-workflows
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
githubnext/gh-cao#20316 ·
Maintainer thường phản hồi trong vòng 1 ngày