feat!: rewrite to use cucumber messages#273
feat!: rewrite to use cucumber messages#273Daan Timmer (daantimmer) wants to merge 237 commits intomainfrom
Conversation
… compatibility kit
…r to catch errors
…ta, doc-strings, empty, examples-tables and minimal
…ooks-beforeall-error, hooks, hooks-attachment and hooks-conditional compatibility tests
✅
|
| 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 |
| 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 | |
| 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
Test Results27 tests - 1 27 ✅ - 1 27s ⏱️ +23s 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.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
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. |
There was a problem hiding this comment.
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.
| 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; |
There was a problem hiding this comment.
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.
| const std::optional<cucumber::messages::pickle_table>& dataTable; | ||
| const std::optional<cucumber::messages::pickle_doc_string>& docString; |
There was a problem hiding this comment.
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.
| 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; |
cucumber_cpp/library/BodyMacro.hpp
Outdated
| 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); | ||
| } |
There was a problem hiding this comment.
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.
| @@ -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. | |||
There was a problem hiding this comment.
Correct the grammar: 'includes' should be 'included' in this sentence.
| 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
|
|
||
| if (CCR_BUILD_TESTS) | ||
| add_subdirectory(test) | ||
| # add_subdirectory(test_helper) |
There was a problem hiding this comment.
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.
| # add_subdirectory(test_helper) | |
| # TODO: Re-enable helper tests when they are ready: add_subdirectory(test_helper) |
|
|
||
| if (CCR_BUILD_TESTS) | ||
| add_subdirectory(test) | ||
| # add_subdirectory(test_helper) |
There was a problem hiding this comment.
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.
| # add_subdirectory(test_helper) |
| target_link_libraries(cucumber_cpp.library.engine PUBLIC | ||
| cucumber_cpp.library | ||
| base64 | ||
| # cucumber_cpp.library |
There was a problem hiding this comment.
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.
| ) | ||
|
|
||
| if (CCR_BUILD_TESTS) | ||
| add_subdirectory(test) |
There was a problem hiding this comment.
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.
| add_subdirectory(test) | |
| add_subdirectory(test) | |
| # TODO: Re-enable test_helper when its tests and dependencies are ready. |
|
|
||
| if (CCR_BUILD_TESTS) | ||
| add_subdirectory(test) | ||
| # add_subdirectory(test_helper) |
There was a problem hiding this comment.
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.
| # add_subdirectory(test_helper) |
| add_subdirectory(tag_expression) | ||
| add_subdirectory(util) | ||
|
|
||
| if (CCR_BUILD_TESTS) |
There was a problem hiding this comment.
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.
| 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. |
|
|
||
| if (CCR_BUILD_TESTS) | ||
| add_subdirectory(test) | ||
| # add_subdirectory(test_helper) |
There was a problem hiding this comment.
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.
| # add_subdirectory(test_helper) |
| # cucumber_cpp.library.engine.test_helper | ||
| # cucumber_cpp.library.engine.test_helper.steps |
There was a problem hiding this comment.
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.
| # cucumber_cpp.library.engine.test_helper | |
| # cucumber_cpp.library.engine.test_helper.steps |
…discard]] attributes and restructuring functions
…eeRegexp, and test files
There was a problem hiding this comment.
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.
|




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.