Skip to content

Handle objects with empty toString - #2662

Merged
natebosch merged 3 commits into
masterfrom
checks-missing-output
Jun 3, 2026
Merged

Handle objects with empty toString#2662
natebosch merged 3 commits into
masterfrom
checks-missing-output

Conversation

@natebosch

Copy link
Copy Markdown
Member

The approach to building text descriptions involves appending and
prepending text to string iterables. If the "base" of the string
description is an empty iterable it propagates through as empty, which
can cause missing lines from the failure output.

Add a fallback of 'empty toString()' in the case any object returns a
completely empty string representation.

The approach to building text descriptions involves appending and
prepending text to string iterables. If the "base" of the string
description is an empty iterable it propagates through as empty, which
can cause missing lines from the failure output.

Add a fallback of `'empty toString()'` in the case any object returns a
completely empty string representation.
@natebosch
natebosch requested a review from a team as a code owner June 1, 2026 19:18
@natebosch
natebosch requested a review from kevmoo June 1, 2026 19:18
@github-actions github-actions Bot added the package:checks Issues related to pkg:checks label Jun 1, 2026
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

@natebosch

Copy link
Copy Markdown
Member Author

I noticed this when trying the migration of package:package_config to checks, it's possible to construct a LanguageVersion instance where to .toString() is empty.

@kevmoo kevmoo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Although CI is sad. 🤷

@natebosch
natebosch merged commit d270d51 into master Jun 3, 2026
66 checks passed
@natebosch
natebosch deleted the checks-missing-output branch June 3, 2026 16:26
natebosch added a commit that referenced this pull request Jun 4, 2026
The approach to building text descriptions involves appending and
prepending text to string iterables. If the "base" of the string
description is an empty iterable it propagates through as empty, which
can cause missing lines from the failure output.

Add a fallback of `'empty toString()'` in the case any object returns a
completely empty string representation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package:checks Issues related to pkg:checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants