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

Aperta
#109 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
cli, testing, tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
0
Fork
6
Merge medio
1g 21h
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/godot-correctness-mcp

Tutte le issue di TMHSDigital/godot-correctness-mcp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.