Print step declaration line instead of handler declaration line#668
Merged
vearutop merged 2 commits intocucumber:mainfrom Jul 19, 2025
Merged
Print step declaration line instead of handler declaration line#668vearutop merged 2 commits intocucumber:mainfrom
vearutop merged 2 commits intocucumber:mainfrom
Conversation
Member
|
Tested locally, looks good. 👍 |
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.
🤔 What's changed?
Pretty printing results now prints the line where the step is declared instead of the line where the handler is declared.
⚡️ What's your motivation?
Printing the file and line number of handlers often produces meaningless results. For example:
ctx.Step("...", func () {...})always point to line 0:some_file_test.go:0ctx.Step("...", instance.Method)always point to:<autogenerated>:1.Pointing to the step declaration does require an additional click to get to the handler code, so an alternative approach would be to improve the reflection process to do a better job locating the handler code.
🏷️ What kind of change is this?
This might be considered breaking if anyone is relying on the previous specific log format in CI tasks.
♻️ Anything particular you want feedback on?
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.