Conversation
Added the `"required": ["cli"]` keyword to the root of `cli.schema.json`. This change explicitly enforces that every CLI definition must include a top-level `cli` object. This strengthens the schema's validation, ensuring that all instances properly define the core CLI structure and preventing partially defined configurations. As a consequence, any existing `cli.schema.json` instance that previously omitted the top-level `cli` property (even if semantically incomplete) will now fail validation, thus requiring all instances to conform to this stricter rule. A comma was also added for correct JSON syntax before the new `required` property. BREAKING CHANGE: This commit introduces breaking changes.
…bject The example CLI definitions in `EXAMPLES.md` and `examples/cli-schema.definition.yml` have been updated to include the mandatory top-level `cli` object. All previously root-level properties, such as `command`, `description`, `version`, `arguments`, and `options`, are now correctly nested under this `cli` key. Additionally, the `README.md` has been updated under the 'Schema Reference' section to explicitly state that all CLI definitions must be nested under a top-level `cli` object. These changes ensure that all provided examples and documentation align with the latest schema requirements, which mandate the `cli` property at the root of every CLI definition. BREAKING CHANGE: This commit introduces breaking changes.
Summary of ChangesHello @ioncakephper, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant structural change to how CLI definitions are managed by enforcing a mandatory top-level Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly enforces the mandatory top-level cli object by updating the JSON schema and relevant documentation. This is a great step towards standardizing the CLI definitions. However, I've noticed that in the process of updating the examples in EXAMPLES.md and examples/cli-schema.definition.yml, some properties were carried over that are inconsistent with the schema. Specifically, command is used instead of the required name, version is used while not being defined in the schema, and alias is used for options instead of short. These inconsistencies will lead to validation errors and should be addressed to ensure the examples are accurate and useful.
| command: cli-schema | ||
| description: Canonical JSON Schema for declarative CLI definitions | ||
| version: '1.0.6' |
There was a problem hiding this comment.
The properties command and version are not valid under the cli object according to schema/cli.schema.json. The schema requires a name property and does not define a version property at this level. This will cause validation to fail. Please use name instead of command and remove the version property to align with the schema.
name: cli-schema
description: Canonical JSON Schema for declarative CLI definitions| command: cli-schema | ||
| description: Canonical JSON Schema for declarative CLI definitions | ||
| version: '1.0.6' |
There was a problem hiding this comment.
The properties command and version used here do not align with the cli.schema.json. According to the schema, the root cli object should have a name property (which is required), not command. Additionally, the version property is not defined in the schema for the cli object. To maintain consistency with the schema and other examples in this file, you should use name and remove version.
| command: cli-schema | |
| description: Canonical JSON Schema for declarative CLI definitions | |
| version: '1.0.6' | |
| name: cli-schema | |
| description: Canonical JSON Schema for declarative CLI definitions |
| - name: help | ||
| alias: h | ||
| description: display help for command | ||
| type: boolean | ||
| - name: version | ||
| alias: V | ||
| description: output the version number | ||
| type: boolean |
There was a problem hiding this comment.
The alias property is not valid for an option definition. According to schema/cli.schema.json, you should use short for the single-letter alias of an option. The alias property is valid for commands, but not for options. This is also inconsistent with the corresponding example in EXAMPLES.md.
- name: help
short: h
description: display help for command
type: boolean
- name: version
short: V
description: output the version number
type: boolean
The example CLI definitions in
EXAMPLES.mdandexamples/cli-schema.definition.ymlhave been updated to include the mandatory top-levelcliobject. All previously root-level properties, such ascommand,description,version,arguments, andoptions, are now correctly nested under thisclikey.Additionally, the
README.mdhas been updated under the 'Schema Reference' section to explicitly state that all CLI definitions must be nested under a top-levelcliobject. These changes ensure that all provided examples and documentation align with the latest schema requirements, which mandate thecliproperty at the root of every CLI definition.BREAKING CHANGE: This commit introduces breaking changes.