Skip to content

no-attribute-formation ignores unit tests - #1529

Merged
yegor256 merged 1 commit into
masterfrom
claude/issue-1527-eca6f7
Oct 2, 2026
Merged

yegor256 merged 1 commit into
masterfrom
claude/issue-1527-eca6f7

Conversation

@yegor256

@yegor256 yegor256 commented Oct 2, 2026

Copy link
Copy Markdown
Member

no-attribute-formation spared a formation only when one of its ancestors had a void attribute. A unit test (++>) is itself a formation with no voids, and has no way to declare one, so the rule reported every test of a top-level, attribute-free object alongside the object itself.

This adds not(ancestor-or-self::o[eo:test-name(@name)]) to the selection, the same way design/excessive-visibility.xsl already excludes tests, and imports /org/eolang/funcs/test-name.xsl for it.

<xsl:for-each select="//o[eo:abstract(.) and @name and not(ancestor::o[eo:abstract(.) and @name and o[@base='∅']]) and not(@name = 'λ' and parent::o[eo:atom(.)]) and not(parent::o[@base='Φ.bytes']) and not(o[@base='∅']) and not(ancestor-or-self::o[eo:test-name(@name)])]">

Closes #1527

The rule spared a formation only when one of its ancestors had a void,
so every unit test of a top-level, attribute-free object was reported
too, even though a test has no way to declare a void of its own. Skip
any formation that is itself a unit test or nested inside one.
Copilot AI balanced review requested due to automatic review settings October 2, 2026 10:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@yegor256
yegor256 merged commit fe41ecf into master Oct 2, 2026
24 checks passed
@yegor256
yegor256 deleted the claude/issue-1527-eca6f7 branch October 2, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no-attribute-formation incorrectly flags tests of top-level objects without arguments

2 participants