chore: Update to cucumber/gherkin v42.0.1 - #425
Open
behat-gherkin-updater[bot] wants to merge 6 commits into
Open
chore: Update to cucumber/gherkin v42.0.1#425behat-gherkin-updater[bot] wants to merge 6 commits into
behat-gherkin-updater[bot] wants to merge 6 commits into
Conversation
Compare: cucumber/gherkin@105ce5f...e214347 ### Changed - [PHP] BREAKING CHANGE: Require PHP 8.4 ### Fixed - [JavaScript] Remove namespace imports from messages
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #425 +/- ##
=========================================
Coverage 95.79% 95.80%
- Complexity 693 694 +1
=========================================
Files 45 45
Lines 2070 2072 +2
=========================================
+ Hits 1983 1985 +2
Misses 87 87
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Compare: cucumber/gherkin@e214347...f2f7b51 ### Added - (i18n) Added Persian translation of "Rule" ([642](https://redirect.github.com/cucumber/gherkin/pull/642)) - (i18n) Added new synonyms for existing Persian keywords ([642](https://redirect.github.com/cucumber/gherkin/pull/642)) - [Dart] Revived Dart implementation as `cucumber_gherkin` ([640](https://redirect.github.com/cucumber/gherkin/pull/640)) ### Changed - Allow steps to have both a DocString and a Datatable argument ([599](https://redirect.github.com/cucumber/gherkin/pull/599), [643](https://redirect.github.com/cucumber/gherkin/pull/643)) - Update dependency messages to at-least v34 ([652](https://redirect.github.com/cucumber/gherkin/pull/652), [643](https://redirect.github.com/cucumber/gherkin/pull/643)) - [cpp] Removed cmate and all related files. ([617](https://redirect.github.com/cucumber/gherkin/pull/617)) - [Ruby] Require Ruby 3.3 ### Fixed - [testdata] removed stray \r\n line endings, replaced with \n. ([617](https://redirect.github.com/cucumber/gherkin/pull/617))
Compare: cucumber/gherkin@f2f7b51...33693f4 ### Added - [Java] Added builder option to use non-deprecated `IdGenerator`. ### Fixed - [Java] Use version range for `org.jspecify:jspecify`
Gherkin v42.0.0 added new testdata examples for feature files with CRLF line separators. Two of these don't match the expected output in our legacy parsing mode, due to existing known differences on parsing escaped table cells and Scenario descriptions.
We have always enforced that a Step can only have a single data table / docstring argument. Previously, this triggered a NodeException from the StepNode constructor. cucumber/gherkin v42.0.0 updated the grammar to allow a Step to have both a DataTable **and** a DocString. The new version includes extra testdata to prove that: * a feature file with a step that has one of each argument is valid. * a feature file with a step having two docstrings is invalid. These were both causing failures because our test logic is based on the Parser throwing a ParserException for an invalid feature file - the NodeException was not expected or handled. Throwing a ParserException is arguably a better end-user experience in this case anyway. Runners will generally report these as an expected error that the user's feature file contains unsupported syntax. NodeException is more likely to be treated as an unexpected / internal error, making it harder for the user to identify and fix the issue.
acoulton
approved these changes
Sep 1, 2026
acoulton
left a comment
Contributor
There was a problem hiding this comment.
The i18n changes all just add new translations, they don't break anything.
Comment on lines
+494
to
+500
| if (count($arguments) > 1) { | ||
| // cucumber/gherkin >= 42.0.0 allows a step to have both a DataTable and a DocString, | ||
| // but we don't support this syntax. We would first need to ensure that runners can | ||
| // cope with a step having more than one argument - although it is typed as an array, | ||
| // it has always been a single-element array. | ||
| throw new ParserException('Multiple step arguments not supported'); | ||
| } |
Contributor
There was a problem hiding this comment.
We potentially could support having a datatable and a docstring in our new parser compatibility mode - but it deserves a separate PR and needs to be tested with Behat.
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.
Automated update