missing-onready --fix writes @onready @export, and misses @onready above a comment
I maintainer di solito rispondono entro 2 giorni
@mafujahmedridoy22-commits ci sta già lavorando.
Dal 14/11/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- tooling
Direzione di ricerca
Inizia da src/lint/rules/missing-onready.ts ed esamina hasOnready e la logica di rilevamento e correzione; poi leggi i casi correlati in test/fixes.test.ts e test/rules.test.ts. Esegui npm run build && npm test come indicato nell’issue. Il lavoro è completato quando vengono gestiti i commenti tra @onready e var, le dichiarazioni esportate non ricevono correzioni e rimangono identiche byte per byte, e le dichiarazioni semplici continuano a essere corrette.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The machine-applicable fix for missing-onready writes wrong code in two cases. gdcorrect lint --fix writes it to user files.
- On an exported member,
@export var x: Node = $Xbecomes@onready @export var x: Node = $X. Godot warns on@onreadycombined with@export(ONREADY_WITH_EXPORT). The initializer then runs after the inspector value is applied and overwrites it, so the designer's assignment is silently lost. A test currently asserts this rewrite as correct. - When a comment sits between a standalone
@onreadyline and thevar, the rule does not see the annotation. It reports a false positive, and--fixadds a second@onready.
Where
src/lint/rules/missing-onready.ts:29(hasOnready: thepreviousNamedSiblingwalk stops at the firstcommentnode)src/lint/rules/missing-onready.ts:42-55(finding and fix are emitted regardless of@export*annotations)test/fixes.test.ts:24-29(expects@onready @export var other: Node = $Other)
Details
@onready
# the player sprite
var a: Node = $A # flagged; --fix -> "@onready var a ..." (second @onready)
@export var c: Node = $C # --fix -> "@onready @export var c ..."
Tree-sitter comments are named nodes, so s.type === "annotation" || s.type === "annotations" ends the loop at the comment.
Impact
--fix is described as applying only machine-applicable fixes. Here it changes runtime behaviour (exported values overwritten at _ready) or produces a redundant annotation, in files the user did not review.
Steps to reproduce
- Put either snippet above in a project script.
- Run
gdcorrect lint <project> --fix, then inspect the file.
Suggested fix
- In
hasOnready, skipcommentsiblings while walking backwards. - When the declaration carries any
@export*annotation, attach nofix. Either keep the finding with a message suggesting an exportedNodePathor no initializer, or skip it. - Update
test/fixes.test.tsto expect no fix for exported members.
Acceptance criteria
-
@onready/ comment /var a = $Ais not flagged. -
@export var n: Node = $Nand@export_*variants have nofix, and--fixleaves those lines byte-identical. - Plain
var n: Node = $Nis still fixed.
Getting started
- Relevant files:
src/lint/rules/missing-onready.ts,test/fixes.test.ts,test/rules.test.ts - How to run tests:
npm run build && npm test
Filed by repo-audit/full-audit at e836036. Severity: medium. Effort: S. audit-key: bug|src/lint/rules/missing-onready.ts|missingOnready.fix
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 6
- Merge medio
- 1g 21h
- PR unite (30g)
- 8
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TMHSDigital/godot-correctness-mcp
-
enhancement good first issue severity: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
TMHSDigital/godot-correctness-mcp#123 ·
I maintainer di solito rispondono entro 2 giorni
-
dependencies good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
TMHSDigital/godot-correctness-mcp#116 ·
I maintainer di solito rispondono entro 2 giorni
-
bug good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
TMHSDigital/godot-correctness-mcp#107 ·
I maintainer di solito rispondono entro 2 giorni
-
bug good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
TMHSDigital/godot-correctness-mcp#106 ·
I maintainer di solito rispondono entro 2 giorni
-
bug good first issue severity: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
TMHSDigital/godot-correctness-mcp#105 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di TMHSDigital/godot-correctness-mcp
Issue simili
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
openclaw/openclaw#203385 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nwverse/persona#12800 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
microsoft/playwright#44289 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 Mezza giornata Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno