-
Notifications
You must be signed in to change notification settings - Fork 41
Feature/2777 multiline strings #360
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
sriv
merged 7 commits into
getgauge:master
from
karimnabli:feature/2777-multiline-strings
Oct 9, 2025
Merged
Feature/2777 multiline strings #360
sriv
merged 7 commits into
getgauge:master
from
karimnabli:feature/2777-multiline-strings
Oct 9, 2025
Conversation
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
7cfdbe3
to
77a4deb
Compare
- Update toFragments() to detect and render multiline strings - Add multilineFragmentKind for proper content display - Add comprehensive test coverage - Preserve formatting and whitespace in multiline content Fixes getgauge/gauge#2777 Signed-off-by: Karim Nabli <[email protected]>
…ge#359) Bumps the github-actions group with 1 update: [actions/setup-go](https://github.com/actions/setup-go). Updates `actions/setup-go` from 5 to 6 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v5...v6) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Karim Nabli <[email protected]>
Bumps the go group with 6 updates: | Package | From | To | | --- | --- | --- | | [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) | `2.24.2` | `2.24.3` | | [google.golang.org/grpc](https://github.com/grpc/grpc-go) | `1.75.0` | `1.75.1` | | google.golang.org/protobuf | `1.36.8` | `1.36.9` | | [golang.org/x/net](https://github.com/golang/net) | `0.43.0` | `0.44.0` | | [golang.org/x/sys](https://github.com/golang/sys) | `0.35.0` | `0.36.0` | | [golang.org/x/text](https://github.com/golang/text) | `0.28.0` | `0.29.0` | Updates `github.com/tdewolff/minify/v2` from 2.24.2 to 2.24.3 - [Release notes](https://github.com/tdewolff/minify/releases) - [Commits](tdewolff/minify@v2.24.2...v2.24.3) Updates `google.golang.org/grpc` from 1.75.0 to 1.75.1 - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.75.0...v1.75.1) Updates `google.golang.org/protobuf` from 1.36.8 to 1.36.9 Updates `golang.org/x/net` from 0.43.0 to 0.44.0 - [Commits](golang/net@v0.43.0...v0.44.0) Updates `golang.org/x/sys` from 0.35.0 to 0.36.0 - [Commits](golang/sys@v0.35.0...v0.36.0) Updates `golang.org/x/text` from 0.28.0 to 0.29.0 - [Release notes](https://github.com/golang/text/releases) - [Commits](golang/text@v0.28.0...v0.29.0) --- updated-dependencies: - dependency-name: github.com/tdewolff/minify/v2 dependency-version: 2.24.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go - dependency-name: google.golang.org/grpc dependency-version: 1.75.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go - dependency-name: google.golang.org/protobuf dependency-version: 1.36.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go - dependency-name: golang.org/x/net dependency-version: 0.44.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: go - dependency-name: golang.org/x/sys dependency-version: 0.36.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: go - dependency-name: golang.org/x/text dependency-version: 0.29.0 dependency-type: indirect update-type: version-update:semver-minor dependency-group: go ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Karim Nabli <[email protected]>
Signed-off-by: Chad Wilson <[email protected]> Signed-off-by: Karim Nabli <[email protected]>
Signed-off-by: Chad Wilson <[email protected]> Signed-off-by: Karim Nabli <[email protected]>
77a4deb
to
ca277ca
Compare
sriv
approved these changes
Oct 9, 2025
my bad: i have pushed the following line in the go.mod |
Signed-off-by: Karim Nabli <[email protected]>
auto-merge was automatically disabled
October 9, 2025 15:28
Head branch was pushed to by a user without write access
sriv
approved these changes
Oct 9, 2025
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.
Gauge Multiline String Feature Implementation
Overview
This implementation of native multiline string support for Gauge, addressing a long-standing feature request. The implementation allows users to include multiline content in step arguments using triple-quote syntax (
"""
).The token (
"""
) must be in a single line, to define that start and the end of the multiline.Changes Made Across Three Projects
1. Gauge Core (gauge repository)
parser/lex.go
extractMultilineContent()
function that identifies and captures content between"""
delimitersGenerateTokens()
to handle multiline content as implicit step argumentsparser/specparser.go
CreateStepUsingLookup()
to detect when a step has multiline content without explicit parameter placeholdersparser/stepParser.go
extractStepValueAndParameterTypes()
to handle multiline contentprocessStep()
to skip parameter processing for implicit multiline stringsgauge/arg.go
MultilineString
constant to support the new parameter typegauge/protoConverters.go
Multiline_String
parameter type inconvertToProtoParameter()
andmakeParameterCopy()
2. Gauge Protocol (gauge-proto repository)
Parameter_Multiline_String
to the protocol buffer definition3. HTML Report Plugin (html-report repository)
toFragments()
function to detect and properly render multiline strings in HTML reportsmultilineFragmentKind
support with proper content preservation3.1 Spec level
3.1.1 Multiline icon representation
3.1.2 Multiline hover
3.1.3 Multiline expansion
3.1 Concept level
Similar to the spec one
Technical Implementation Details
Parsing Logic
"""
following a step as multiline block start"""
delimiters is captured as a single string, preserving all formattingstepToken.Args[0]
Parameter Handling
{}
placeholders needed)gauge_messages.Parameter_Multiline_String
parameter typegauge_messages.Fragment
with parameter type for renderingKey Design Decisions
Usage Examples
Before (Workarounds)
After (Native Support)
Multiple Use Cases
Benefits Achieved
Backward Compatibility
"""
syntax is usedTesting Coverage
The implementation includes comprehensive tests covering:
Core Functionality
Edge Cases
Integration
Test Status:
Protocol Impact
Parameter_Multiline_String
to the protocol buffer definitionconvertToProtoParameter()
andmakeParameterCopy()
to handle the new typePerformance Considerations
"""
is detectedReview Notes
Next Steps
This implementation finally provides native multiline string support in Gauge while maintaining the framework's commitment to readability, usability, and backward compatibility. The feature aligns Gauge with modern testing tool expectations and eliminates the need for workarounds when dealing with structured data or code snippets in specifications.