Skip to content

chore: Update to cucumber/gherkin v42.0.1 - #425

Open
behat-gherkin-updater[bot] wants to merge 6 commits into
masterfrom
cucumber-update-1781950110
Open

chore: Update to cucumber/gherkin v42.0.1#425
behat-gherkin-updater[bot] wants to merge 6 commits into
masterfrom
cucumber-update-1781950110

Conversation

@behat-gherkin-updater

Copy link
Copy Markdown
Contributor

Automated update

Compare: cucumber/gherkin@105ce5f...e214347

### Changed
- [PHP] BREAKING CHANGE: Require PHP 8.4

### Fixed
- [JavaScript] Remove namespace imports from messages
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.80%. Comparing base (a304216) to head (b64d35c).
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ
php8.1 95.80% <100.00%> (+<0.01%) ⬆️
php8.1--with=symfony/yaml:^5.4 95.80% <100.00%> (+<0.01%) ⬆️
php8.1--with=symfony/yaml:^6.4 95.80% <100.00%> (+<0.01%) ⬆️
php8.2 95.80% <100.00%> (+<0.01%) ⬆️
php8.3 95.80% <100.00%> (+<0.01%) ⬆️
php8.4 95.80% <100.00%> (+<0.01%) ⬆️
php8.5 95.80% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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))
@behat-gherkin-updater behat-gherkin-updater Bot changed the title chore: Update to cucumber/gherkin v41.0.0 chore: Update to cucumber/gherkin v42.0.0 Jul 20, 2026
Compare: cucumber/gherkin@f2f7b51...33693f4

### Added
- [Java] Added builder option to use non-deprecated `IdGenerator`.

### Fixed
- [Java] Use version range for `org.jspecify:jspecify`
@behat-gherkin-updater behat-gherkin-updater Bot changed the title chore: Update to cucumber/gherkin v42.0.0 chore: Update to cucumber/gherkin v42.0.1 Aug 6, 2026
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 acoulton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The i18n changes all just add new translations, they don't break anything.

Comment thread src/Parser.php
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');
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant