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

Abierto Apto para principiantes
#250 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, node.js
Área
cli, tooling

Línea de trabajo

Lee site/check-links.mjs alrededor de las líneas 99–105 y site/lib/link-check.mjs alrededor de las líneas 54–63; luego sigue cómo las opciones analizadas llegan a staleDaysFrom. Ejecuta las pruebas pertinentes para --stale-days=30 y --stale-days 30, además de un valor no válido. La tarea estará terminada cuando ambas formas válidas usen un límite de 30 días y los valores no válidos sigan fallando.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
JavaScript
Estrellas
58
Forks
15
Merge medio
1 d 15 h
PR fusionados (30 d)
12

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TMHSDigital/Free-Game-Dev-Assets

Todos los issues de TMHSDigital/Free-Game-Dev-Assets

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.