scene-node-path-missing false positive for $Path inside an inner class

オープン 初心者向け
#105 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
testing-qa

調査の方向性

Read src/scenes/node-paths.ts around lines 31–49 to see how pathUses walks class definitions, then review the related cases in test/node-paths.test.ts. Run npm run build && npm test to check the behavior; done means the inner-class $Label repro reports no warning while a top-level $Missing still does.

索引モデルが issue の本文から書いたものです。

説明

bug good first issue severity: medium

Summary

scene-node-path-missing resolves $Path and get_node("...") literals inside inner classes (class Helper extends Node:) against the scene node the outer script is attached to. Those paths refer to the inner class instance's children, so the warning is a false positive.

Where

  • src/scenes/node-paths.ts:31-49 (pathUses walks the whole tree, including class_definition bodies)

Steps to reproduce

  1. Create main.tscn with root Main (script main.gd, extends Node2D) and one child, Sprite.
  2. In main.gd:
    class Helper extends Node:
        func f() -> void:
            $Label.show()
    
  3. gdcorrect validate-scenes . reports WARNING scene-node-path-missing Node path "Label" does not exist under this script's node.

Impact

Scripts that nest Node subclasses get spurious warnings, and --fail-on warning turns them into CI failures.

Suggested fix

In pathUses, do not descend into class_definition nodes. Only the top-level class body is attached to the scene node.

Acceptance criteria

  • The repro reports nothing.
  • A top-level $Missing still reports.

Getting started

  • Relevant files: src/scenes/node-paths.ts, test/node-paths.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/scenes/node-paths.ts|pathUses

主要言語
TypeScript
スター
0
フォーク
6
平均マージ
1日 21時間
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/godot-correctness-mcp のほかの issue

TMHSDigital/godot-correctness-mcp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。