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.35s
✅ CPP clang-format 181 0 0 0 1.29s
✅ DOCKERFILE hadolint 1 0 0 0.32s
✅ JSON jsonlint 8 0 0 0.16s
✅ JSON prettier 8 6 0 0 0.47s
⚠️ MARKDOWN markdownlint 6 3 13 0 0.85s
✅ MARKDOWN markdown-table-formatter 6 3 0 0 0.28s
✅ REPOSITORY git_diff yes no no 0.02s
✅ REPOSITORY grype yes no no 27.74s
✅ REPOSITORY ls-lint yes no no 0.06s
✅ REPOSITORY secretlint yes no no 2.1s
✅ REPOSITORY syft yes no no 1.18s
✅ REPOSITORY trivy yes no no 4.96s
✅ REPOSITORY trivy-sbom yes no no 0.11s
✅ REPOSITORY trufflehog yes no no 2.17s
⚠️ SPELL lychee 73 1 0 3.92s
✅ YAML prettier 10 0 0 0 0.52s
✅ YAML v8r 10 0 0 6.23s
✅ YAML yamllint 10 0 0 0.49s

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 ✅  11s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 6e50738.

♻️ This comment has been updated with latest results.

Copilot AI review requested due to automatic review settings January 6, 2026 10:30
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 372 changed files in this pull request and generated 3 comments.


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

return {};
}

std::vector<cucumber::messages::rule> ExtractRulesFeatureChild(const cucumber::messages::feature_child& child)
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Function name 'ExtractRulesFeatureChild' has inconsistent grammar. Consider renaming to 'ExtractRulesFromFeatureChild' to match the pattern of 'ExtractScenarioFromRuleChild'.

Suggested change
std::vector<cucumber::messages::rule> ExtractRulesFeatureChild(const cucumber::messages::feature_child& child)
std::vector<cucumber::messages::rule> ExtractRulesFromFeatureChild(const cucumber::messages::feature_child& child)

Copilot uses AI. Check for mistakes.
{
const static std::string integerNegativeRegex{ R"__(-?\d+)__" };
const static std::string integerPositiveRegex{ R"__(\d+)__" };
const static std::string floatRegex{ R"__((?=.*\d.*)[-+]?\d*(?:\.(?=\d.*))?\d*(?:\d+[E][+-]?\d+)?)__" };
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The string regex combines double and single quote patterns inline. Consider splitting into separate 'stringDoubleRegex' and 'stringSingleRegex' constants for better readability, or add a comment explaining the combined pattern.

Suggested change
const static std::string floatRegex{ R"__((?=.*\d.*)[-+]?\d*(?:\.(?=\d.*))?\d*(?:\d+[E][+-]?\d+)?)__" };
const static std::string floatRegex{ R"__((?=.*\d.*)[-+]?\d*(?:\.(?=\d.*))?\d*(?:\d+[E][+-]?\d+)?)__" };
// Matches either a double-quoted ("...") or single-quoted ('...') string,
// allowing for escaped quotes and backslashes within the string content.

Copilot uses AI. Check for mistakes.
if (!assembledTestSuiteMap.contains(pickleSource.gherkinDocument->uri.value()))
{
testUris.emplace_back(pickleSource.gherkinDocument->uri.value());
assembledTestSuiteMap.emplace(pickleSource.gherkinDocument->uri.value(), *pickleSource.gherkinDocument);
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The gherkinDocument is dereferenced and copied here. If the gherkinDocument is already shared/managed elsewhere, consider storing a reference or shared_ptr to avoid the copy.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 6, 2026 11:16
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 372 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 January 6, 2026 11:48
Copy link

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "bats",
"type": "shell",
"command": "bats --formatter junit cucumber_cpp/acceptance_test/test.bats",
"problemMatcher": []
}
]

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 373 changed files in this pull request and generated 6 comments.


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

Comment on lines +31 to +38
# cucumber_cpp.library
# cucumber_cpp.library.util
cucumber_cpp.library.cucumber_expression
)

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

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Commented-out dependencies should either be uncommented if required or removed if not needed. Leaving commented dependencies can cause confusion about actual project dependencies.

Suggested change
# cucumber_cpp.library
# cucumber_cpp.library.util
cucumber_cpp.library.cucumber_expression
)
if (CCR_BUILD_TESTS)
# add_subdirectory(test)
# add_subdirectory(test_helper)
cucumber_cpp.library.cucumber_expression
)
if (CCR_BUILD_TESTS)

Copilot uses AI. Check for mistakes.
Comment on lines +35 to +39

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

Copilot AI Jan 6, 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 be uncommented once tests are ready, or removed if they're not planned. This pattern appears across multiple CMakeLists.txt files.

Suggested change
if (CCR_BUILD_TESTS)
# add_subdirectory(test)
# add_subdirectory(test_helper)
endif()

Copilot uses AI. Check for mistakes.
Comment on lines +114 to +116
void PrettyPrinter::HandleAttachment(const cucumber::messages::attachment& attachment)
{
/* TODO implement */
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Method HandleAttachment is not implemented. Either implement the functionality or remove the method if not needed for the current scope.

Suggested change
void PrettyPrinter::HandleAttachment(const cucumber::messages::attachment& attachment)
{
/* TODO implement */
void PrettyPrinter::HandleAttachment(const cucumber::messages::attachment& /*attachment*/)
{
// Attachments are currently ignored by PrettyPrinter. This is an intentional no-op.

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +24
# add_subdirectory(test)
# add_subdirectory(test_helper)
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Test subdirectories are commented out. Consider enabling them or removing the comments if tests are not planned for this component.

Suggested change
# add_subdirectory(test)
# add_subdirectory(test_helper)
# No tests are currently defined for this target.

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 6, 2026

Choose a reason for hiding this comment

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

Incomplete conditional check. Either complete the logic or remove the commented code.

Suggested change
// if (lineage.examples)

Copilot uses AI. Check for mistakes.
{
testCaseStartedById.try_emplace(testCaseStarted.id, testCaseStarted);

/* reset data? https://github.dev/cucumber/query/blob/f31732e5972c1815614f1d83928a7065e3080dc4/javascript/src/Query.ts#L249 */
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

TODO comment with reference link suggests incomplete implementation. Either implement the data reset logic or document why it's not needed in this implementation.

Suggested change
/* reset data? https://github.dev/cucumber/query/blob/f31732e5972c1815614f1d83928a7065e3080dc4/javascript/src/Query.ts#L249 */
// Note: In the JavaScript/TypeScript implementation referenced below, this
// handler resets per-scenario "current" state (for example, the current
// test case / test step identifiers). This C++ implementation does not
// store such transient state on the Query instance: it records all data
// in *_ById maps and derives any needed context from the message IDs.
// As a result, there is no additional per-scenario state that needs to be
// reset here.
// Reference: https://github.dev/cucumber/query/blob/f31732e5972c1815614f1d83928a7065e3080dc4/javascript/src/Query.ts#L249

Copilot uses AI. Check for mistakes.
Copy link

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

"id": "tag",
"description": "Enter the tag to run",
"type": "pickString",
"options": [
"@smoke",
"@rule1 or @smoke",
"@keyword-asterisk",
"@result:UNDEFINED",
"@result:FAILED",
"@result:OK",
"@fail_feature",
"@ex:2",
"@substep",
"@table_argument",
"@thishasarule"
]
},
{
"id": "features",
"description": "Enter the tag to run",
"type": "pickString",
"options": [
"cucumber_cpp/example/features",
"cucumber_cpp/example/features/rule.feature",
"cucumber_cpp/example/features/substep.feature",
"cucumber_cpp/acceptance_test/features",
"cucumber_cpp/devkit/empty/features"
]

Copy link

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

],
"configurations": [

Copy link

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [
"--com",
"COMx",
"--nordic",
"--format",
"summary",
"--tags",
"${input:tag}",
"--",
"${input:features}"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "ASAN_OPTIONS",
"value": "detect_leaks=0"
}
],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},

Copy link

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

"name": "(gdb) Launch - no tags",
"type": "cppdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [
"--com",
"COMx",
"--nordic",
"--format",
"summary",
"--",
"${input:features}"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 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