Skip to content

Annotate test fixtures instead of suppressing purity issues - #166

Merged
danog merged 2 commits into
masterfrom
annotate-fixture-purity
Oct 20, 2026
Merged

danog merged 2 commits into
masterfrom
annotate-fixture-purity

Conversation

@danog

@danog danog commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

The acceptance test configs suppressed Psalm 7's missing purity/immutability annotation issues instead of the fixtures declaring them.

Before:

<issueHandlers>
  <MissingPureAnnotation errorLevel="suppress" />
  <MissingAbstractPureAnnotation errorLevel="suppress" />
  <MissingImmutableAnnotation errorLevel="suppress" />
  <MissingInterfaceImmutableAnnotation errorLevel="suppress" />
</issueHandlers>
interface I { public function work(): int; }

After:

/** @psalm-mutable */
interface I {
  /** @psalm-impure */
  public function work(): int;
}

Needs vimeo/psalm#12421: without it Psalm rejects @psalm-pure on the generator providers.

https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW

danog added 2 commits October 20, 2026 11:11
The acceptance configs suppressed MissingPureAnnotation,
MissingAbstractPureAnnotation, MissingImmutableAnnotation and
MissingInterfaceImmutableAnnotation. Declare the purity of the fixture
code instead. Annotated generator providers return iterable[pure], so the
expected messages that print the provider type now include it.

Claude-Session: https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW
They were marked read-props only because Psalm took generator functions
without a return statement for void ones (vimeo/psalm#12421).

Claude-Session: https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW
@danog
danog merged commit 01a0871 into master Oct 20, 2026
17 of 28 checks passed
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.

1 participant