From fe28386b91d9bffb631e5f24ec0a490d7f51aa50 Mon Sep 17 00:00:00 2001 From: Pierre van de Laar Date: Fri, 18 Sep 2026 16:50:17 +0200 Subject: [PATCH 1/2] Two files are ignored by ruff - as they are intentionally invalid and a legacy example --- features/targets/go/node.py | 2 -- pyproject.toml | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/targets/go/node.py b/features/targets/go/node.py index 987a050f..7d01b097 100644 --- a/features/targets/go/node.py +++ b/features/targets/go/node.py @@ -17,8 +17,6 @@ class GoAstNode: def properties(self) -> dict[str, Any]: return {"length": self.length, "offset": self.offset, "name": self.name} - children: list[Self] = [] - @property def children(self) -> list[Self]: 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 From d4f3727408f07396a9b7c0362ff2f8e790961ab1 Mon Sep 17 00:00:00 2001 From: Pierre van de Laar Date: Fri, 18 Sep 2026 16:54:09 +0200 Subject: [PATCH 2/2] Also statisfy RUFF D checks --- features/targets/go/node.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/features/targets/go/node.py b/features/targets/go/node.py index 7d01b097..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,8 +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} @property def children(self) -> list[Self]: + """Return this node's direct child nodes (expr, body, other).""" return [self.expr, self.body, self.other]