Skip to content

feat!: rewrite to use cucumber messages#273

Open
Daan Timmer (daantimmer) wants to merge 237 commits intomainfrom
feature/rewrite-to-use-cucumber-messages
Open

feat!: rewrite to use cucumber messages#273
Daan Timmer (daantimmer) wants to merge 237 commits intomainfrom
feature/rewrite-to-use-cucumber-messages

Conversation

@daantimmer
Copy link
Collaborator

@daantimmer Daan Timmer (daantimmer) commented Dec 18, 2025

This (internal) rewrite is to make amp-cucumber-cpp-runner cucumber-messages compatible. Both during runtime and during formatting.

This will enable amp-cucumber-cpp-runner to be compatible with other, standalone, formatters.

  • implement all compatibility tests (37 / 39 done)
  • auto search for feature files if no paths are given
  • use CLI11's 'config file' option
  • implement minimum formatters
    • console/file: summary (partially done)
      • allow theming/disabling colouring
    • console/file: pretty printer (partially done)
      • allow theming/disabling colouring
    • console/file: step statistics
    • console/file: ndjson
    • console/file: junit

…ta, doc-strings, empty, examples-tables and minimal
…ooks-beforeall-error, hooks, hooks-attachment and hooks-conditional compatibility tests
@github-actions
Copy link

github-actions bot commented Dec 18, 2025

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 6 0 0 0.29s
✅ CPP clang-format 190 0 0 0 1.64s
✅ DOCKERFILE hadolint 1 0 0 0.31s
✅ JSON jsonlint 8 0 0 0.19s
✅ JSON prettier 8 6 0 0 0.55s
⚠️ MARKDOWN markdownlint 6 3 14 0 1.09s
✅ MARKDOWN markdown-table-formatter 6 3 0 0 0.29s
✅ REPOSITORY git_diff yes no no 0.03s
✅ REPOSITORY grype yes no no 30.91s
✅ REPOSITORY ls-lint yes no no 0.07s
✅ REPOSITORY secretlint yes no no 2.08s
✅ REPOSITORY syft yes no no 1.22s
✅ REPOSITORY trivy yes no no 5.62s
✅ REPOSITORY trivy-sbom yes no no 0.12s
✅ REPOSITORY trufflehog yes no no 2.17s
⚠️ SPELL lychee 83 2 0 3.59s
✅ YAML prettier 10 0 0 0 0.55s
✅ YAML v8r 10 0 0 4.81s
✅ YAML yamllint 10 0 0 0.55s

Detailed Issues

⚠️ SPELL / lychee - 2 errors
[ERROR] https://www.conventionalcommits.org/en/v1.0.0/ | Network error: error sending request for url (https://www.conventionalcommits.org/en/v1.0.0/) Maybe a certificate error?
[404] https://github.com/yourname/amp-cucumber-cpp-runner.git | Network error: Not Found
📝 Summary
---------------------
🔍 Total..........155
✅ Successful.....153
⏳ Timeouts.........0
🔀 Redirected.......0
👻 Excluded.........0
❓ Unknown..........0
🚫 Errors...........2

Errors in CONTRIBUTING.md
[404] https://github.com/yourname/amp-cucumber-cpp-runner.git | Network error: Not Found

Errors in .github/workflows/pr-conventional-title.yml
[ERROR] https://www.conventionalcommits.org/en/v1.0.0/ | Network error: error sending request for url (https://www.conventionalcommits.org/en/v1.0.0/) Maybe a certificate error?
⚠️ MARKDOWN / markdownlint - 14 errors
CHANGELOG.md:26 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
CHANGELOG.md:38 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:47 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:53 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
CHANGELOG.md:61 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "⚠ BREAKING CHANGES"]
CHANGELOG.md:65 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:70 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:79 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:90 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
CHANGELOG.md:98 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "⚠ BREAKING CHANGES"]
CHANGELOG.md:102 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:127 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:134 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
README.md:114 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.3.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_GIT_DIFF,REPOSITORY_GRYPE,REPOSITORY_LS_LINT,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

Test Results

27 tests   - 1   27 ✅  - 1   27s ⏱️ +23s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 4c33bf8. ± Comparison against base commit 947fe10.

This pull request removes 6 and adds 5 tests. Note that renamed tests count towards both.
test.bats ‑ Missing mandatory feature argument
test.bats ‑ Missing mandatory report argument
test.bats ‑ Second feature file does not overwrite success with an undefined status
test.bats ‑ Test the asterisk keyword - will fail
test.bats ‑ Test unused step reporting
test.bats ‑ Undefined tests
test.bats ‑ Second feature file does not overwrite success with an ■ status
test.bats ‑ Test nested steps
test.bats ‑ Test the asterisk keyword
test.bats ‑ Test usage formatter
test.bats ‑ ■ tests

♻️ This comment has been updated with latest results.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 291 out of 381 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 16, 2026 14:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 291 out of 381 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI commented Feb 17, 2026

Daan Timmer (@daantimmer) I've opened a new pull request, #290, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI review requested due to automatic review settings February 17, 2026 12:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 291 out of 383 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +20 to +21
StepBase(const runtime::NestedTestCaseRunner& nestedTestCaseRunner, util::Broadcaster& broadCaster, Context& context, engine::StepOrHookStarted stepOrHookStarted, const std::optional<cucumber::messages::pickle_table>& dataTable, const std::optional<cucumber::messages::pickle_doc_string>& docString);
virtual ~StepBase() = default;
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

StepBase stores dataTable and docString as reference members. This makes the type very sensitive to the caller’s lifetimes (passing temporaries will create dangling references). Consider storing these by value (cheap for std::optional wrappers), or storing pointers/std::reference_wrapper with explicit “may be null” semantics, or at least documenting/enforcing that the referenced optionals must outlive the step object.

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +42
const std::optional<cucumber::messages::pickle_table>& dataTable;
const std::optional<cucumber::messages::pickle_doc_string>& docString;
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

StepBase stores dataTable and docString as reference members. This makes the type very sensitive to the caller’s lifetimes (passing temporaries will create dangling references). Consider storing these by value (cheap for std::optional wrappers), or storing pointers/std::reference_wrapper with explicit “may be null” semantics, or at least documenting/enforcing that the referenced optionals must outlive the step object.

Suggested change
const std::optional<cucumber::messages::pickle_table>& dataTable;
const std::optional<cucumber::messages::pickle_doc_string>& docString;
std::optional<cucumber::messages::pickle_table> dataTable;
std::optional<cucumber::messages::pickle_doc_string> docString;

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 14
template<class T>
T TransformArg(const cucumber::messages::step_match_argument& match)
{
return cucumber_cpp::library::cucumber_expression::ConverterTypeMap<T>::Instance().at(match.parameter_type_name.value_or(""))(match.group);
}
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

TransformArg is defined in the global namespace in a widely included header, which increases the chance of name collisions and makes ADL/visibility harder to reason about. Consider moving it under a cucumber_cpp::library::detail (or similar) namespace (and keeping it header-only) to reduce symbol pollution.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,6 @@
Feature: Unused steps
Depending on the run, some step definitions may not be used. This is valid, and the step definitions are still
includes in the stream of messages, which allows formatters to report on step usage if desired.
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Correct the grammar: 'includes' should be 'included' in this sentence.

Suggested change
includes in the stream of messages, which allows formatters to report on step usage if desired.
included in the stream of messages, which allows formatters to report on step usage if desired.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 17, 2026 14:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 291 out of 383 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 17, 2026 14:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 291 out of 383 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

#include "cucumber_cpp/library/cucumber_expression/Errors.hpp"
#include "cucumber_cpp/library/cucumber_expression/Expression.hpp"
#include "cucumber_cpp/library/cucumber_expression/ParameterRegistry.hpp"
#include "fmt/format.h"
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The header include order should be consistent. Standard library headers (like <string>, <vector>) should come after third-party headers. Consider moving fmt/format.h after the cucumber headers but before standard library headers.

Copilot uses AI. Check for mistakes.

if (CCR_BUILD_TESTS)
add_subdirectory(test)
# add_subdirectory(test_helper)
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Commented-out code should be removed unless there's a specific reason to keep it. If this is intentionally disabled pending future work, add a TODO comment explaining why.

Suggested change
# add_subdirectory(test_helper)
# TODO: Re-enable helper tests when they are ready: add_subdirectory(test_helper)

Copilot uses AI. Check for mistakes.

if (CCR_BUILD_TESTS)
add_subdirectory(test)
# add_subdirectory(test_helper)
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Commented-out code should be removed unless there's a specific reason to keep it. If this is intentionally disabled pending future work, add a TODO comment explaining why.

Suggested change
# add_subdirectory(test_helper)

Copilot uses AI. Check for mistakes.
target_link_libraries(cucumber_cpp.library.engine PUBLIC
cucumber_cpp.library
base64
# cucumber_cpp.library
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Commented-out code should be removed unless there's a specific reason to keep it. If this is intentionally disabled pending future work, add a TODO comment explaining why.

Copilot uses AI. Check for mistakes.
)

if (CCR_BUILD_TESTS)
add_subdirectory(test)
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Commented-out code should be removed unless there's a specific reason to keep it. If this is intentionally disabled pending future work, add a TODO comment explaining why.

Suggested change
add_subdirectory(test)
add_subdirectory(test)
# TODO: Re-enable test_helper when its tests and dependencies are ready.

Copilot uses AI. Check for mistakes.

if (CCR_BUILD_TESTS)
add_subdirectory(test)
# add_subdirectory(test_helper)
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Commented-out code should be removed unless there's a specific reason to keep it. If this is intentionally disabled pending future work, add a TODO comment explaining why.

Suggested change
# add_subdirectory(test_helper)

Copilot uses AI. Check for mistakes.
add_subdirectory(tag_expression)
add_subdirectory(util)

if (CCR_BUILD_TESTS)
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Commented-out code should be removed unless there's a specific reason to keep it. If this is intentionally disabled pending future work, add a TODO comment explaining why.

Suggested change
if (CCR_BUILD_TESTS)
if (CCR_BUILD_TESTS)
# TODO: Re-enable the test subdirectory when the test suite is ready to be built with this library.

Copilot uses AI. Check for mistakes.

if (CCR_BUILD_TESTS)
add_subdirectory(test)
# add_subdirectory(test_helper)
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Commented-out code should be removed unless there's a specific reason to keep it. If this is intentionally disabled pending future work, add a TODO comment explaining why.

Suggested change
# add_subdirectory(test_helper)

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +9
# cucumber_cpp.library.engine.test_helper
# cucumber_cpp.library.engine.test_helper.steps
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Commented-out code should be removed unless there's a specific reason to keep it. If this is intentionally disabled pending future work, add a TODO comment explaining why.

Suggested change
# cucumber_cpp.library.engine.test_helper
# cucumber_cpp.library.engine.test_helper.steps

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 19, 2026 16:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 291 out of 395 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

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.

5 participants