diff --git a/features/targets/go/node.py b/features/targets/go/node.py index 987a050f..b3338fea 100644 --- a/features/targets/go/node.py +++ b/features/targets/go/node.py @@ -1,8 +1,12 @@ +"""Fixture source modeling a Go AST node for CST/AST refactoring tests.""" + from collections.abc import Sequence from typing import Any, Self class GoAstNode: + """Base node type exposing Go AST children, properties, and rewrite metadata.""" + # direct access protocol expr: Self body: Sequence[Self] @@ -15,10 +19,10 @@ class GoAstNode: @property def properties(self) -> dict[str, Any]: + """Return the rewrite metadata (length, offset, name) for this node.""" return {"length": self.length, "offset": self.offset, "name": self.name} - children: list[Self] = [] - @property def children(self) -> list[Self]: + """Return this node's direct child nodes (expr, body, other).""" return [self.expr, self.body, self.other] diff --git a/pyproject.toml b/pyproject.toml index 44faff4d..fcff3ae4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,9 +95,11 @@ skip_covered = false line-length = 140 src = ["src", "test", "features"] extend-exclude = [ - "features/targets/invalid.py", - "features/targets/taut/taut_test.py", # legacy fixture source, not real code - "features/targets/go/node.py", # legacy fixture source, not real code + "features/targets/taut/taut_test.py", # legacy example, not real code + "features/targets/invalid.py", # deliberately invalid Python (syntax errors); per docs/developer/ + # coding-conventions.md we prefer line-based `# noqa` suppression, + # but invalid-syntax has no rule code so it can't be suppressed + # that way (or via per-file-ignores) — file-level exclusion only ] force-exclude = true