Skip to content

Conversation

@daantimmer
Copy link
Collaborator

@daantimmer 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)
  • implement minimum formatters
    • console: summary (partially done)
    • console: pretty printer (partially done)
    • file: ndjson (partially done)
    • file: nunit / xunit

@daantimmer daantimmer mentioned this pull request Dec 18, 2025
15 tasks
@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.34s
✅ CPP clang-format 191 0 0 0 1.4s
✅ DOCKERFILE hadolint 1 0 0 0.3s
✅ JSON jsonlint 8 0 0 0.19s
✅ JSON prettier 8 6 0 0 0.49s
⚠️ MARKDOWN markdownlint 6 3 13 0 0.77s
✅ MARKDOWN markdown-table-formatter 6 3 0 0 0.29s
✅ REPOSITORY git_diff yes no no 0.02s
✅ REPOSITORY grype yes no no 27.18s
✅ REPOSITORY ls-lint yes no no 0.06s
✅ REPOSITORY secretlint yes no no 2.15s
✅ REPOSITORY syft yes no no 1.14s
✅ REPOSITORY trivy yes no no 5.4s
✅ REPOSITORY trivy-sbom yes no no 0.12s
✅ REPOSITORY trufflehog yes no no 2.16s
⚠️ SPELL lychee 82 1 0 6.63s
✅ YAML prettier 10 0 0 0 0.5s
✅ YAML v8r 10 0 0 5.11s
✅ YAML yamllint 10 0 0 0.4s

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

MegaLinter is graciously provided by OX Security

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

Test Results

26 tests   26 ✅  13s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 3af273c.

♻️ This comment has been updated with latest results.

Copilot AI review requested due to automatic review settings January 8, 2026 11:22
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 374 changed files in this pull request and generated 3 comments.


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

void Step::Given(const std::string& step) const
{
TestRunner::Instance().NestedStep(StepType::given, step);
// CucumberTestServer::Instance()->RunStep(step, cucumber::messages::pickle_step_type::CONTEXT);
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

Commented-out code for nested step execution should either be implemented or removed. If this functionality is planned for future implementation, add a TODO comment explaining the plan and timeline.

Copilot uses AI. Check for mistakes.

void PrettyPrinter::HandleTestRunFinished(const cucumber::messages::test_run_finished& testRunFinished)
{
/* TODO implement */
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The HandleTestRunFinished method contains a TODO comment but no implementation. Consider implementing this method or documenting why it's intentionally left empty.

Suggested change
/* TODO implement */
// Intentionally left blank: PrettyPrinter does not currently render any
// additional output when a test run finishes. This handler is provided
// for interface completeness.
(void)testRunFinished;

Copilot uses AI. Check for mistakes.
{
auto parameterIters = treeRegexp.RootBuilder().Children() | std::views::transform([&parameterRegistry](const GroupBuilder& groupBuilder) -> Parameter
{
return parameterRegistry.Lookup("");
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The lambda always looks up an empty string parameter name instead of using information from the groupBuilder. This appears to be incorrect - the groupBuilder parameter should likely be used to determine which parameter to look up.

Suggested change
return parameterRegistry.Lookup("");
return parameterRegistry.Lookup(groupBuilder.Name());

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 8, 2026 16:05
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 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 @@

Copy link

Copilot AI Jan 8, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,185 @@

Copy link

Copilot AI Jan 8, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
@@ -1,107 +1,103 @@

Copy link

Copilot AI Jan 8, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
@@ -1,14 +1,12 @@

Copy link

Copilot AI Jan 8, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,23 @@

Copy link

Copilot AI Jan 8, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 8, 2026 22:58
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 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.

Comment on lines 35 to 36
# add_subdirectory(test)
# add_subdirectory(test_helper)
Copy link

Copilot AI Jan 8, 2026

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.

Suggested change
# add_subdirectory(test)
# add_subdirectory(test_helper)

Copilot uses AI. Check for mistakes.

add_subdirectory(helper)


Copy link

Copilot AI Jan 8, 2026

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.

Suggested change

Copilot uses AI. Check for mistakes.
void Step::Given(const std::string& step) const
{
TestRunner::Instance().NestedStep(StepType::given, step);
// CucumberTestServer::Instance()->RunStep(step, cucumber::messages::pickle_step_type::CONTEXT);
Copy link

Copilot AI Jan 8, 2026

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.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +39
/*
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;
}
*/

Copy link

Copilot AI Jan 8, 2026

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.

Suggested change
/*
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 uses AI. Check for mistakes.
target_link_libraries(cucumber_cpp.library.cucumber_expression.test PUBLIC
gmock_main
GTest::gmock_main
GTest::gmock
Copy link

Copilot AI Jan 8, 2026

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.

Suggested change
GTest::gmock

Copilot uses AI. Check for mistakes.
return StringTo<T>(matches.begin()->str());
if (matches.value.has_value())
return StringTo<T>(matches.value.value());
return {};
Copy link

Copilot AI Jan 8, 2026

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.

Suggested change
return {};
throw CucumberExpressionError{
"No value available to convert in CreateStreamConverter"
};

Copilot uses AI. Check for mistakes.
Comment on lines +148 to +155
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);
}
Copy link

Copilot AI Jan 8, 2026

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.

Copilot uses AI. Check for mistakes.
const cucumber::messages::location& Query::FindLocationOf(const cucumber::messages::pickle& pickle) const
{
const auto& lineage = FindLineageByUri(pickle.uri);
// if (lineage.examples)
Copy link

Copilot AI Jan 8, 2026

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.

Suggested change
// 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.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 9, 2026 13:48
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 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.
Copilot AI review requested due to automatic review settings January 9, 2026 15:07
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 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);
Copy link

Copilot AI Jan 9, 2026

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2026

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.

3 participants