Skip to content

suite.Run: refactor handling of stats for improved readability #1764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025

Conversation

dolmen
Copy link
Collaborator

@dolmen dolmen commented Jun 5, 2025

Summary

Refactor handling of stats in suite.Run with the goal of reducing indented blocks to improve readability.

Changes

The SuiteInformation methods now handle being called with a nil receiver to work as no-op. This allows to call them from suite.Run without nil checks blocks, so with improved readability thanks to the removal of indented blocks.

Motivation

Improve readability of suite.Run.

Related issues

N/A

@dolmen dolmen added pkg-suite Change related to package testify/suite internal/refactor Refactor internals with no external visible changes internal/cleanup Internal change to ease maintenance without external impact labels Jun 5, 2025
@dolmen dolmen self-assigned this Jun 16, 2025
@dolmen
Copy link
Collaborator Author

dolmen commented Jun 16, 2025

@renzoarreaza Could you review this change? I'm asking you as you recently had a look at suite internals.

@dolmen dolmen force-pushed the dolmen/suite-refactor-stats-for-readability branch from 888850d to fc6b3ea Compare June 16, 2025 14:37
@renzoarreaza
Copy link
Contributor

@renzoarreaza Could you review this change? I'm asking you as you recently had a look at suite internals.

Looks good!

Refactor handling of stats in suite.Run with the goal of reducing
indented blocks to improve readability.

To achieve this, the SuiteInformation methods now handle being called
with a nil receiver to work as noop. This allows to call them from
suite.Run without nil checks blocks, so with improved readability.
@dolmen dolmen force-pushed the dolmen/suite-refactor-stats-for-readability branch from fc6b3ea to 87101a6 Compare June 30, 2025 16:06
@dolmen dolmen merged commit c58bc90 into master Jun 30, 2025
16 checks passed
@dolmen dolmen deleted the dolmen/suite-refactor-stats-for-readability branch June 30, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal/cleanup Internal change to ease maintenance without external impact internal/refactor Refactor internals with no external visible changes pkg-suite Change related to package testify/suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants