docs: Fix EventuallyWithTf documentation with proper placement of formatting arguments#1842
Merged
dolmen merged 1 commit intostretchr:masterfrom Feb 23, 2026
Conversation
dolmen
requested changes
Feb 17, 2026
_codegen/main.go
Outdated
| comment := strings.Replace(f.Comment(), search, replace, -1) | ||
| exp := regexp.MustCompile(replace + `\(((\(\)|[^\n])+)\)`) | ||
| comment := strings.ReplaceAll(f.Comment(), search, replace) | ||
| if strings.Contains(search, "EventuallyWithT") { |
Collaborator
There was a problem hiding this comment.
What about looking for the ..."external state... string instead?
Contributor
Author
There was a problem hiding this comment.
This suggestion simplified the implementation. Thanks!
df7336c to
a270037
Compare
- Updated code generation logic to handle msgAndArgs in EventuallyWithTf comments, ensuring correct formatting and removal of obsolete messages. - Revised example comments in assertion_format.go, assertion_forward.go, require.go, and require_forward.go to use the new signature and message format for EventuallyWithTf. Signed-off-by: a2not <31874975+a2not@users.noreply.github.com>
a270037 to
967a7b7
Compare
dolmen
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed the regexp for
CommentFormat()code-generation function such that it properly captures the outer most closing parenthesis of a function call in code comment.testify/_codegen/main.go
Line 291 in 65697ce
Changes
EventuallyWithThasmsgAndArgsas the last argument, which needs to be replaced by two separatemsgandargsinEventuallyWithTf. I've implemented with very naive approach which might need to be improved.Motivation
Misleading documentation
Related issues
Closes #1833