Skip to content
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

Add JSONSchema for my CLIs #67

Closed
suzuki-shunsuke opened this issue Dec 28, 2024 · 2 comments
Closed

Add JSONSchema for my CLIs #67

suzuki-shunsuke opened this issue Dec 28, 2024 · 2 comments

Comments

@suzuki-shunsuke
Copy link
Contributor Author

Done.

@suzuki-shunsuke
Copy link
Contributor Author

suzuki-shunsuke commented Dec 30, 2024

Input Complementation by YAML Language Server

I've published JSON Schema for configuration files of my CLIs such as aqua, tfcmt, github-comment, and so on.
Using these JSON Schema, editors such as VSCode can complement inputs and warn invalid settings.

To do that, please add a code comment to configuration files.

# yaml-language-server: $schema=<URL of JSON Schema file>

About URL of JSON Schema file, please check the document of each tool out.

e.g. aqua.yaml:

# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/<Schema version>/json-schema/aqua-yaml.json

e.g. schema version is main:

# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/main/json-schema/aqua-yaml.json

If you specify a branch like main as a schema version, editors can't reflect the update of JSON Schema well as they cache JSON Schema.
You would need to do something like reopening the file.

To solve the problem, you can specify semver and update it periodically:

e.g. schema version is v2.40.0:

# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/v2.40.0/json-schema/aqua-yaml.json

Using Renovate and our Renovate Config Preset, you can automate the update:

{
  "extends": [
    "github>suzuki-shunsuke/renovate-config:yaml-language-server#3.0.0"
  ]
}

Then Renovate creates pull requests like this:

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

No branches or pull requests

1 participant