-
Notifications
You must be signed in to change notification settings - Fork 4
feat!: rewrite to use cucumber messages #273
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
base: main
Are you sure you want to change the base?
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.34s | |
| ✅ CPP | clang-format | 191 | 0 | 0 | 0 | 1.36s |
| ✅ DOCKERFILE | hadolint | 1 | 0 | 0 | 0.33s | |
| ✅ JSON | jsonlint | 8 | 0 | 0 | 0.19s | |
| ✅ JSON | prettier | 8 | 6 | 0 | 0 | 0.48s |
| markdownlint | 6 | 3 | 13 | 0 | 0.79s | |
| ✅ MARKDOWN | markdown-table-formatter | 6 | 3 | 0 | 0 | 0.28s |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.03s | |
| ✅ REPOSITORY | grype | yes | no | no | 27.62s | |
| ✅ REPOSITORY | ls-lint | yes | no | no | 0.06s | |
| ✅ REPOSITORY | secretlint | yes | no | no | 2.16s | |
| ✅ REPOSITORY | syft | yes | no | no | 1.19s | |
| ✅ REPOSITORY | trivy | yes | no | no | 5.01s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.12s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 2.17s | |
| lychee | 83 | 1 | 0 | 7.61s | ||
| ✅ YAML | prettier | 10 | 0 | 0 | 0 | 0.5s |
| ✅ YAML | v8r | 10 | 0 | 0 | 5.77s | |
| ✅ YAML | yamllint | 10 | 0 | 0 | 0.44s |
Detailed Issues
⚠️ SPELL / lychee - 1 error
[404] https://github.com/yourname/amp-cucumber-cpp-runner.git | Network error: Not Found
📝 Summary
---------------------
🔍 Total..........153
✅ Successful.....152
⏳ Timeouts.........0
🔀 Redirected.......0
👻 Excluded.........0
❓ Unknown..........0
🚫 Errors...........1
Errors in CONTRIBUTING.md
[404] https://github.com/yourname/amp-cucumber-cpp-runner.git | Network error: Not Found
⚠️ MARKDOWN / markdownlint - 13 errors
CHANGELOG.md:26 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
CHANGELOG.md:38 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:47 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:53 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
CHANGELOG.md:61 MD024/no-duplicate-heading Multiple headings with the same content [Context: "⚠ BREAKING CHANGES"]
CHANGELOG.md:65 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:70 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:79 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:90 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
CHANGELOG.md:98 MD024/no-duplicate-heading Multiple headings with the same content [Context: "⚠ BREAKING CHANGES"]
CHANGELOG.md:102 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:127 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:134 MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
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 [email protected] --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 Results26 tests 26 ✅ 13s ⏱️ Results for commit 8e9835a. ♻️ This comment has been updated with latest results. |
There was a problem hiding this 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 377 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
cucumber_cpp/library/cucumber_expression/test/TestTransformation.cpp:15
- Empty line at the start of the file should be removed for consistency with other files in the codebase.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,72 @@ | |||
|
|
|||
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line at the start of the file should be removed for consistency with other files in the codebase.
| @@ -0,0 +1,185 @@ | |||
|
|
|||
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line at the start of the file should be removed for consistency with other files in the codebase.
| @@ -1,107 +1,103 @@ | |||
|
|
|||
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line at the start of the file should be removed for consistency with other files in the codebase.
| @@ -1,14 +1,12 @@ | |||
|
|
|||
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line at the start of the file should be removed for consistency with other files in the codebase.
| @@ -0,0 +1,23 @@ | |||
|
|
|||
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line at the start of the file should be removed for consistency with other files in the codebase.
There was a problem hiding this 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 377 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # add_subdirectory(test) | ||
| # add_subdirectory(test_helper) |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out test subdirectories should either be implemented or removed. Leaving them commented suggests incomplete work or technical debt.
| # add_subdirectory(test) | |
| # add_subdirectory(test_helper) |
|
|
||
| add_subdirectory(helper) | ||
|
|
||
|
|
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove one of the duplicate empty lines before the if statement.
| void Step::Given(const std::string& step) const | ||
| { | ||
| TestRunner::Instance().NestedStep(StepType::given, step); | ||
| // CucumberTestServer::Instance()->RunStep(step, cucumber::messages::pickle_step_type::CONTEXT); |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code or replace with a TODO comment explaining why this functionality is temporarily disabled and when it will be implemented.
| /* | ||
| std::optional<std::string> read_file( std::istream & is ) { | ||
| if( not is.seekg( 0, std::ios_base::seek_dir::end ) ) { | ||
| return std::nullopt; | ||
| } | ||
| auto const sz = is.tellg( ); | ||
| if( not is.seekg( 0 ) ) { | ||
| return std::nullopt; | ||
| } | ||
| auto result = std::string( '\0', static_cast<std::size_t>( sz ) ); | ||
| if( not is.read( result.data( ), sz ) ) { | ||
| return std::nullopt; | ||
| } | ||
| if( sz != is.gcount( ) ) { | ||
| return std::nullopt; | ||
| } | ||
| return result; | ||
| } | ||
| */ | ||
|
|
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this large commented-out code block. If this functionality might be needed later, consider moving it to a separate utility file or documenting why it's preserved.
| /* | |
| std::optional<std::string> read_file( std::istream & is ) { | |
| if( not is.seekg( 0, std::ios_base::seek_dir::end ) ) { | |
| return std::nullopt; | |
| } | |
| auto const sz = is.tellg( ); | |
| if( not is.seekg( 0 ) ) { | |
| return std::nullopt; | |
| } | |
| auto result = std::string( '\0', static_cast<std::size_t>( sz ) ); | |
| if( not is.read( result.data( ), sz ) ) { | |
| return std::nullopt; | |
| } | |
| if( sz != is.gcount( ) ) { | |
| return std::nullopt; | |
| } | |
| return result; | |
| } | |
| */ |
| target_link_libraries(cucumber_cpp.library.cucumber_expression.test PUBLIC | ||
| gmock_main | ||
| GTest::gmock_main | ||
| GTest::gmock |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target 'gmock_main' on line 4 appears to be a duplicate of 'GTest::gmock_main' on line 5. This may cause build issues or ambiguity. Remove the non-namespaced version.
| GTest::gmock |
| return StringTo<T>(matches.begin()->str()); | ||
| if (matches.value.has_value()) | ||
| return StringTo<T>(matches.value.value()); | ||
| return {}; |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning an empty object when a value is not found may mask errors. Consider throwing an exception or returning std::nullopt to make the failure explicit.
| return {}; | |
| throw CucumberExpressionError{ | |
| "No value available to convert in CreateStreamConverter" | |
| }; |
| void signal_handler(int signal) | ||
| { | ||
| if (signal == SIGABRT) | ||
| std::cerr << "SIGABRT received\n"; | ||
| else | ||
| std::cerr << "Unexpected signal " << signal << " received\n"; | ||
| std::_Exit(EXIT_FAILURE); | ||
| } |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name 'signal_handler' is too generic. Consider renaming to 'abort_signal_handler' or 'cucumber_abort_handler' to better reflect its specific purpose.
| const cucumber::messages::location& Query::FindLocationOf(const cucumber::messages::pickle& pickle) const | ||
| { | ||
| const auto& lineage = FindLineageByUri(pickle.uri); | ||
| // if (lineage.examples) |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or complete this commented-out conditional check. If examples handling is not yet implemented, add a TODO comment explaining what needs to be done.
| // if (lineage.examples) | |
| // TODO: When examples handling is implemented, use lineage.examples (e.g., example row location) | |
| // instead of always returning the scenario's location. |
There was a problem hiding this 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 380 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.
- Updated include paths for Query to use the new query structure. - Modified Formatter and related classes to accept the new query type. - Added test directories and dummy test files for api, assemble, formatter, query, runtime, and util components. - Enhanced CMakeLists.txt files to include test executables and link necessary libraries. - Introduced a new Query class to encapsulate query-related functionalities and improve code organization. - Ensured all references to the old Query class are replaced with the new structure across the codebase.
There was a problem hiding this 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 400 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cli.add_flag("--fail-fast", options.failFast, "Stop execution on first failure"); | ||
| cli.add_option("--format", options.format, "specify the output format, optionally supply PATH to redirect formatter output.")->check(formatValidator); | ||
| cli.add_option("--format-options", options.formatOptions, "provide options for formatters"); | ||
| cli.add_option("--language", options.language, "Default langauge for feature files, eg 'en'")->default_str(options.language); |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'langauge' to 'language' in help text.
| cli.add_option("--language", options.language, "Default langauge for feature files, eg 'en'")->default_str(options.language); | |
| cli.add_option("--language", options.language, "Default language for feature files, eg 'en'")->default_str(options.language); |
| } }); | ||
|
|
||
| bool seenSteps = false; | ||
| bool error = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
| @@ -1,6 +1,6 @@ | |||
| set(CMAKE_COMPILE_WARNING_AS_ERROR On) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
cucumber_cpp/library/CMakeLists.txt
Outdated
| @@ -1,27 +1,18 @@ | |||
| set(CMAKE_COMPILE_WARNING_AS_ERROR On) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved toplevel if CCR_STANDALONE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this 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 405 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| UndefinedParameterTypeError::UndefinedParameterTypeError(const Node& node, std::string expression, std::string undefinedParameterName) | ||
| : Error{ | ||
| node.Start(), | ||
| expression, | ||
| PointAtLocated(node), | ||
| std::format(R"(Undefined parameter type '{}')", undefinedParameterName), | ||
| std::format(R"(Please register a ParameterType for '{}')", undefinedParameterName), | ||
| } | ||
| , expression{ std::move(expression) } | ||
| , undefinedParameterName{ std::move(undefinedParameterName) } |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constructor parameter types changed from string_view to string, but the parameters are moved into member variables. Consider accepting by string_view and explicitly converting to string in the initializer list to avoid unnecessary copies when string_view is passed.
| UndefinedParameterTypeError::UndefinedParameterTypeError(const Node& node, std::string expression, std::string undefinedParameterName) | |
| : Error{ | |
| node.Start(), | |
| expression, | |
| PointAtLocated(node), | |
| std::format(R"(Undefined parameter type '{}')", undefinedParameterName), | |
| std::format(R"(Please register a ParameterType for '{}')", undefinedParameterName), | |
| } | |
| , expression{ std::move(expression) } | |
| , undefinedParameterName{ std::move(undefinedParameterName) } | |
| UndefinedParameterTypeError::UndefinedParameterTypeError(const Node& node, std::string_view expression_sv, std::string_view undefinedParameterName_sv) | |
| : Error{ | |
| node.Start(), | |
| expression_sv, | |
| PointAtLocated(node), | |
| std::format(R"(Undefined parameter type '{}')", undefinedParameterName_sv), | |
| std::format(R"(Please register a ParameterType for '{}')", undefinedParameterName_sv), | |
| } | |
| , expression{ std::string(expression_sv) } | |
| , undefinedParameterName{ std::string(undefinedParameterName_sv) } |
| struct TestExpression : testing::Test | ||
| { | ||
| ParameterRegistry parameterRegistry{}; | ||
| ParameterRegistry parameterRegistry{ {} }; |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty braces initialization { {} } is used to construct ParameterRegistry. Consider using more explicit initialization like ParameterRegistry parameterRegistry{ std::set<CustomParameterEntry, std::less<>>{} } for clarity.
|




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.