missing-onready --fix writes @onready @export, and misses @onready above a comment
Maintainer thường phản hồi trong vòng 2 ngày
@mafujahmedridoy22-commits đang làm issue này rồi.
Từ ngày 14/11/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bắt đầu với src/lint/rules/missing-onready.ts và kiểm tra hasOnready cùng logic phát hiện và sửa lỗi; sau đó đọc các trường hợp liên quan trong test/fixes.test.ts và test/rules.test.ts. Chạy npm run build && npm test như được liệt kê trong issue. Công việc hoàn tất khi các chú thích giữa @onready và var được xử lý, các khai báo được export không nhận bản sửa và vẫn giống hệt từng byte, còn các khai báo thông thường vẫn được sửa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 0
- Fork
- 6
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/godot-correctness-mcp
-
enhancement good first issue severity: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
TMHSDigital/godot-correctness-mcp#123 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
dependencies good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TMHSDigital/godot-correctness-mcp#116 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
TMHSDigital/godot-correctness-mcp#107 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
TMHSDigital/godot-correctness-mcp#106 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug good first issue severity: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TMHSDigital/godot-correctness-mcp#105 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của TMHSDigital/godot-correctness-mcp
Issue tương tự
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
openclaw/openclaw#203385 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nwverse/persona#12800 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/playwright#44289 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày