Make the device scripts answer --help and refuse bad flags
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
- 90/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
Línea de trabajo
Empieza con las pruebas de CLI en scripts/devices/validate.test.mjs y scripts/devices/table.test.mjs; después, lee las líneas de uso en el comentario de encabezado de cada script y su función main(). Añade cobertura para la ayuda, las flags desconocidas y los valores que faltan, usando un archivo de documentación temporal para comprobar que los argumentos no válidos de la tabla lo dejan sin cambios. Ejecuta node --test scripts/devices/*.test.mjs y confirma que validate.mjs sigue aceptando los argumentos --event, --github-output y --comment del workflow.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Why
docs/devices.md tells people to check a report with node scripts/devices/validate.mjs report.json, but --help makes that script try to open a file named --help, and table.mjs rewrites docs/devices.md when given a flag it doesn't know. ROADMAP.md, Now: the Device lab.
What to do
Today:
node scripts/devices/validate.mjs --helpprintsENOENT: no such file or directory, open '--help'.node scripts/devices/table.mjsignores flags it doesn't know, so--helpor a typo like--chekrewrites docs/devices.md instead of checking it, and--datawith no folder after it writes a table with no reports.
- Test first, in
scripts/devices/validate.test.mjsandscripts/devices/table.test.mjs, which already run the scripts withexecFileSync:--helpand-hprint the usage and exit 0, for both scripts;table.mjswith an unknown flag, or with--dataor--docand no value after it, prints the usage, exits 1 and leaves the doc unchanged. Use a temporary doc file, as the existing CLI test does.
- In each script's
main(), handle--helpand-hfirst, then refuse unknown arguments and flags with no value. Reuse the usage lines from each file's header comment.
Done when
- The new tests pass, and every existing test in
scripts/devices/still passes. validate.mjsbehaves exactly as before when called the way.github/workflows/device-report.ymlcalls it:--event,--github-outputand--comment.
How to check
node --test scripts/devices/*.test.mjs
node scripts/devices/validate.mjs --help
node scripts/devices/table.mjs --check
Keep in mind
validate.mjsruns on public issues. It reads the issue as data and runs nothing from it. Keep it that way, and never print a report's values in an error.- Don't run
node scripts/devices/table.mjswithout--checkon your branch unless you mean to rewrite the table. - Node built-ins only. No new dependency.
- Lenguaje dominante
- TypeScript
- Estrellas
- 11
- Forks
- 0
- Merge medio
- 10 min
- PR fusionados (30 d)
- 6
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DojoCodingLabs/hermit
-
docs good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
DojoCodingLabs/hermit#73 ·
Los mantenedores suelen responder en 1 día
-
device-lab
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
DojoCodingLabs/hermit#45 ·
Los mantenedores suelen responder en 1 día
-
device-lab
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
DojoCodingLabs/hermit#44 ·
Los mantenedores suelen responder en 1 día
-
device-lab
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DojoCodingLabs/hermit#43 ·
Los mantenedores suelen responder en 1 día
-
agent-friendly docs good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
DojoCodingLabs/hermit#39 ·
Los mantenedores suelen responder en 1 día
Todos los issues de DojoCodingLabs/hermit
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
superlinked/sie#1033 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
remix-run/react-router#15838 ·
Los mantenedores suelen responder en 1 día
-
area/ci bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
melgarafael/DeskcommCRM#5290 ·
Los mantenedores suelen responder en 1 día