CLI edge cases: rules accepts stray flags, locale-dependent sort, --fix scope

Abierto
#109 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript
Área
cli, testing, tooling

Línea de trabajo

Start with the listed sections of src/cli.ts, src/lint/project.ts, src/baseline.ts, and src/lint/rules/stringly-nodepath.ts, then inspect related cases in test/cli.test.ts. Run npm run build && npm test to see the current behavior. Done means each listed edge case has a documented decision or code change and a test; the issue describes several interacting CLI and fix-policy decisions.

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

Descripción

severity: low tech-debt

Summary

Small CLI edge cases left over after the strict-arguments work (#68) and the new --fix flag.

Where

  • src/cli.ts:315 (rules returns before any flag validation)
  • src/cli.ts:75-77, src/lint/project.ts:39-41, src/baseline.ts:69-71 (localeCompare with no fixed locale)
  • src/lint/rules/stringly-nodepath.ts:30-41, src/cli.ts:353-357 (--fix scope)

Details and checklist

  • gdcorrect rules silently accepts --fail-on bogus, --fix, --files, --baseline and --write-baseline. That contradicts the strict-CLI contract. Reject flags that do not apply to rules, with exit 2.
  • Sorting with a.localeCompare(b) and no fixed locale makes output order, and the order of entries in a written baseline file, depend on the machine's ICU locale. That can cause baseline diffs between developers and CI. Use a plain code-unit comparison, or localeCompare(b, "en").
  • The stringly-nodepath fix rewrites get_node("A/B") to $A/B. That is the same literal path, which the finding itself calls rename-fragile, so the fix hides the finding without addressing it. --fix also applies every attached fix regardless of severity. Either:
    • reword the rule as a style preference, or
    • add --fix-rule <id>, or limit --fix to findings at or above --fail-on.
  • --fix runs before the baseline filter (cli.ts:353-364), so baselined findings are rewritten too. Decide whether that is intended, and document or change it.

Acceptance criteria

  • Each item above is either changed or documented, with a test.

Getting started

  • Relevant files: src/cli.ts, src/lint/project.ts, src/baseline.ts, test/cli.test.ts
  • How to run tests: npm run build && npm test

Filed by repo-audit/full-audit at e836036. Severity: low. Effort: S. audit-key: quality|src/cli.ts|misc

Lenguaje dominante
TypeScript
Estrellas
0
Forks
6
Merge medio
1 d 21 h
PR fusionados (30 d)
8

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/godot-correctness-mcp

Todos los issues de TMHSDigital/godot-correctness-mcp

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.