check-links accepts --stale-days=N and then ignores it (365 is used)

オープン 初心者向け
#250 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, node.js
領域
cli, tooling

調査の方向性

site/check-links.mjsの99~105行付近とsite/lib/link-check.mjsの54~63行付近を読み、解析されたフラグがstaleDaysFromに渡される経路をたどってください。--stale-days=30と--stale-days 30の両方、および無効な値について、該当するテストを実行してください。両方の有効な形式で30日間の期限が使われ、無効な値は引き続き失敗すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug good first issue priority: low

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-105
  • site/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

  1. node site/check-links.mjs --stale-days=30 --report r.md
  2. 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=30 and --stale-days 30 both 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 is npm 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時間
マージ済み PR(30日)
12

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/Free-Game-Dev-Assets のほかの issue

TMHSDigital/Free-Game-Dev-Assets の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。