Bare gdcorrect-ignore that silences a scene finding is reported as unused-suppression

Abierto
#102 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
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
testing-qa

Línea de trabajo

Start by reading src/lint/suppressions.ts and the lint and scene reporting flow in src/lint/engine.ts and src/scenes/report.ts; then inspect test/suppressions.test.ts and run npm run build && npm test. Trace how bare directives are counted across lint and scene findings. Done means the repro no longer reports a matched bare directive as unused, unmatched bare directives still are reported, and the node-path suggestion names scene-node-path-missing.

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

Descripción

bug severity: medium

Summary

A bare # gdcorrect-ignore (no rule list) in a .gd file that silences a scene or project finding is reported by the lint pass as unused-suppression. The tool's own suggestion for scene-node-path-missing tells users to write exactly that comment.

Where

  • src/lint/suppressions.ts:82 (the out-of-scope exemption only applies when d.rules is non-null)
  • src/lint/engine.ts:32-40
  • src/scenes/node-paths.ts:119 (suggestion: "suppress with # gdcorrect-ignore")
  • src/scenes/input-actions.ts:89

Details

if (d.used) continue;
if (d.rules && [...d.rules].every(outOfScope)) continue;   // bare directive: rules === null -> reported

The scene passes honor the directive with reportUnused=false. The lint pass never sees those scene findings, so it treats the bare directive as unused.

Impact

Following the tool's advice produces a new finding. report shows unused-suppression for a directive that did suppress something, and --fail-on info (or a severity override on that rule) fails the run. Introduced with 2e316b6.

Steps to reproduce

  1. In a scene-attached script main.gd, inside _ready, add $Spawned.show() # gdcorrect-ignore (where Spawned is not in the scene) and if Input.is_action_pressed("jmp"): # gdcorrect-ignore.
  2. Run gdcorrect report <project> --format pretty. Both lines get INFO unused-suppression, and the scene findings are (correctly) hidden.

Suggested fix

Pick one:

  • Do the unused-suppression bookkeeping once per file over the combined lint and scene/project findings.
  • Have the lint pass leave bare directives on lines containing a node-path literal or an input-action call unreported.

In either case, change the node-path suggestion to recommend # gdcorrect-ignore[scene-node-path-missing].

Acceptance criteria

  • The repro produces no unused-suppression findings.
  • A bare directive that matches nothing in any pass is still reported.

Getting started

  • Relevant files: src/lint/suppressions.ts, src/lint/engine.ts, src/scenes/report.ts, test/suppressions.test.ts
  • How to run tests: npm run build && npm test

Filed by repo-audit/full-audit at e836036. Severity: medium. Effort: M. audit-key: bug|src/lint/suppressions.ts|applySuppressions

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.