Skip to content

test/docker-environment#63

Merged
Jumpaku merged 6 commits intomainfrom
test/docker-environment
Jul 21, 2025
Merged

test/docker-environment#63
Jumpaku merged 6 commits intomainfrom
test/docker-environment

Conversation

@Jumpaku
Copy link
Owner

@Jumpaku Jumpaku commented Jul 20, 2025

This pull request introduces several updates to the cyamli project, including schema version upgrades, documentation enhancements, and new features for testing and code generation. The changes are grouped into three main themes: schema updates, documentation updates, and testing/code generation improvements.

Schema Updates:

  • Updated the $id in docs/cyamli-cli.schema.json and docs/cyamli-cli.schema.yaml to reflect the new version v2.0.0-beta.2. This ensures the schema aligns with the latest version. [1] [2]

Documentation Updates:

  • Changed version references in docs/cyamli-docs.html, docs/cyamli-docs.md, and docs/cyamli-docs.text from v2.0.0-beta.1 to v2.0.0-beta.2. This keeps the documentation consistent with the new release. [1] [2] [3]
  • Added documentation for a new CLI option -include-header=<string> in docs/cyamli-docs.html, docs/cyamli-docs.md, and docs/cyamli-docs.text. This option specifies the path to the generated header file for C++ source files. [1] [2] [3]

Testing and Code Generation Improvements:

  • Added a Dockerfile to set up a GCC-based testing environment for C++ (gcc:15.1.0).
  • Introduced a Makefile with targets for generating, building, and testing C++ examples using Docker Compose. This streamlines the testing process for different examples.
  • Added a .gitignore entry to exclude binary files (**/*.bin) generated during testing.
  • Generated a new header file test/cyamli/cli.gen.h with structured definitions for CLI inputs and handlers. This supports the new -include-header option and facilitates C++ code generation.

@Jumpaku Jumpaku requested a review from Copilot July 21, 2025 17:04
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

This PR adds Kotlin and Golang test environments to the project, establishing a multi-language testing infrastructure for the CLI generation tool. The test environments enable verification of generated CLI code across different target languages.

  • Adds Kotlin test environment with Gradle build configuration and Docker support
  • Adds Golang test environment with Go modules and Docker support
  • Includes generated CLI code files for multiple examples (cyamli, demo, features) in both languages

Reviewed Changes

Copilot reviewed 67 out of 169 changed files in this pull request and generated 4 comments.

File Description
test/kotlin/* Complete Kotlin test environment with Gradle build, Docker setup, and generated CLI code
test/golang/* Complete Golang test environment with Go modules, Docker setup, and generated CLI code
test/dart3/test/features/cli_test.g.dart Generated Dart test file for features example

return
}

if (arguments.size < 2) {
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

This condition is incorrect. For arguments at index 2 and beyond, the check should be arguments.size < 3 to ensure at least 3 arguments are present (indices 0, 1, and 2+).

Suggested change
if (arguments.size < 2) {
if (arguments.size < 3) {

Copilot uses AI. Check for mistakes.
}

if (arguments.size < 2) {
errorMessage = "Too few arguments: required at least ${expectedArgs - 1}, got ${arguments.size}"
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

The error message calculation is incorrect. If expectedArgs is 3 and we need at least 3 arguments for the variadic case, the message should say 'required at least 3' not 'required at least 2'.

Suggested change
errorMessage = "Too few arguments: required at least ${expectedArgs - 1}, got ${arguments.size}"
errorMessage = "Too few arguments: required at least ${expectedArgs}, got ${arguments.size}"

Copilot uses AI. Check for mistakes.
Comment on lines +436 to +440
// Parses a string value to String
internal fun parseString(strValue: String): String {
return strValue
}

Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

[nitpick] This function simply returns the input string unchanged. Consider if this function adds value or if it's just unnecessary indirection.

Suggested change
// Parses a string value to String
internal fun parseString(strValue: String): String {
return strValue
}

Copilot uses AI. Check for mistakes.

// Parses a list of string values to a list of String
internal fun parseArrayString(strValues: List<String>): List<String> {
return strValues.map { parseString(it) }
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

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

[nitpick] This function maps over the list calling parseString on each element, which just returns the same string. This could be simplified to just return the input list directly.

Suggested change
return strValues.map { parseString(it) }
return strValues

Copilot uses AI. Check for mistakes.
@Jumpaku Jumpaku marked this pull request as ready for review July 21, 2025 18:01
@Jumpaku Jumpaku merged commit f19320d into main Jul 21, 2025
1 check passed
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.

2 participants