-
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.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 |
| 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 | |
| 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
Test Results26 tests 26 ✅ 11s ⏱️ Results for commit 6e50738. ♻️ This comment has been updated with latest results. |
…irectory size checks
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 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) |
Copilot
AI
Jan 6, 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.
Function name 'ExtractRulesFeatureChild' has inconsistent grammar. Consider renaming to 'ExtractRulesFromFeatureChild' to match the pattern of 'ExtractScenarioFromRuleChild'.
| std::vector<cucumber::messages::rule> ExtractRulesFeatureChild(const cucumber::messages::feature_child& child) | |
| std::vector<cucumber::messages::rule> ExtractRulesFromFeatureChild(const cucumber::messages::feature_child& child) |
| { | ||
| 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+)?)__" }; |
Copilot
AI
Jan 6, 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 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.
| 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. |
| if (!assembledTestSuiteMap.contains(pickleSource.gherkinDocument->uri.value())) | ||
| { | ||
| testUris.emplace_back(pickleSource.gherkinDocument->uri.value()); | ||
| assembledTestSuiteMap.emplace(pickleSource.gherkinDocument->uri.value(), *pickleSource.gherkinDocument); |
Copilot
AI
Jan 6, 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 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.
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 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.
… to static analysis workflow
…nd format options
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.
[MegaLinter] reported by reviewdog 🐶
amp-cucumber-cpp-runner/.vscode/tasks.json
Lines 2 to 12 in 8c18af3
| // 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": [] | |
| } | |
| ] |
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 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.
| # cucumber_cpp.library | ||
| # cucumber_cpp.library.util | ||
| cucumber_cpp.library.cucumber_expression | ||
| ) | ||
|
|
||
| if (CCR_BUILD_TESTS) | ||
| # add_subdirectory(test) | ||
| # add_subdirectory(test_helper) |
Copilot
AI
Jan 6, 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 dependencies should either be uncommented if required or removed if not needed. Leaving commented dependencies can cause confusion about actual project dependencies.
| # 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) |
|
|
||
| if (CCR_BUILD_TESTS) | ||
| # add_subdirectory(test) | ||
| # add_subdirectory(test_helper) | ||
| endif() |
Copilot
AI
Jan 6, 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 be uncommented once tests are ready, or removed if they're not planned. This pattern appears across multiple CMakeLists.txt files.
| if (CCR_BUILD_TESTS) | |
| # add_subdirectory(test) | |
| # add_subdirectory(test_helper) | |
| endif() |
| void PrettyPrinter::HandleAttachment(const cucumber::messages::attachment& attachment) | ||
| { | ||
| /* TODO implement */ |
Copilot
AI
Jan 6, 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.
Method HandleAttachment is not implemented. Either implement the functionality or remove the method if not needed for the current scope.
| 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. |
| # add_subdirectory(test) | ||
| # add_subdirectory(test_helper) |
Copilot
AI
Jan 6, 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.
Test subdirectories are commented out. Consider enabling them or removing the comments if tests are not planned for this component.
| # add_subdirectory(test) | |
| # add_subdirectory(test_helper) | |
| # No tests are currently defined for this target. |
| const cucumber::messages::location& Query::FindLocationOf(const cucumber::messages::pickle& pickle) const | ||
| { | ||
| const auto& lineage = FindLineageByUri(pickle.uri); | ||
| // if (lineage.examples) |
Copilot
AI
Jan 6, 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.
Incomplete conditional check. Either complete the logic or remove the commented code.
| // if (lineage.examples) |
| { | ||
| testCaseStartedById.try_emplace(testCaseStarted.id, testCaseStarted); | ||
|
|
||
| /* reset data? https://github.dev/cucumber/query/blob/f31732e5972c1815614f1d83928a7065e3080dc4/javascript/src/Query.ts#L249 */ |
Copilot
AI
Jan 6, 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.
TODO comment with reference link suggests incomplete implementation. Either implement the data reset logic or document why it's not needed in this implementation.
| /* 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 |
…for improved clarity
…ion and update operator+= signatures for consistency
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.
[MegaLinter] reported by reviewdog 🐶
amp-cucumber-cpp-runner/.vscode/launch.json
Lines 8 to 35 in 6e50738
| "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" | |
| ] |
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.
[MegaLinter] reported by reviewdog 🐶
amp-cucumber-cpp-runner/.vscode/launch.json
Lines 37 to 38 in 6e50738
| ], | |
| "configurations": [ |
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.
[MegaLinter] reported by reviewdog 🐶
amp-cucumber-cpp-runner/.vscode/launch.json
Lines 40 to 72 in 6e50738
| "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 | |
| } | |
| ] | |
| }, |
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.
[MegaLinter] reported by reviewdog 🐶
amp-cucumber-cpp-runner/.vscode/launch.json
Lines 74 to 99 in 6e50738
| "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 | |
| } | |
| ] | |
| }, |
|




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.