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

Ouverte
#109 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
55/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
node.js, typescript
Domaine
cli, testing, tooling

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
TypeScript
Étoiles
0
Forks
6
Merge moyen
1 j 21 h
PR mergées (30 j)
8

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/godot-correctness-mcp

Toutes les issues de TMHSDigital/godot-correctness-mcp

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.