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

Use JSON Schema to make IDE support yaml lint and hint. #385

Open
1 task done
Mini256 opened this issue Mar 3, 2021 · 5 comments
Open
1 task done

Use JSON Schema to make IDE support yaml lint and hint. #385

Mini256 opened this issue Mar 3, 2021 · 5 comments
Labels
lifecycle/rotten type/feature Categorizes issue or PR as related to a new feature.

Comments

@Mini256
Copy link
Member

Mini256 commented Mar 3, 2021

Feature Request

  • I have searched the issues of this repository and believe that this is not a duplicate.

Describe the feature you'd like:

We can use JSON Schema to make IDE support yaml lint and hint, which can help us avoid some errors on IDE prompts.

Do you have any ideas on how to implement it?(Optional)

We can use jsonschema to automatically generate JSON Schema according to the Go language type definition, and then import the json file into the configuration in the IDE (Such as Goland).

config

type Configuration struct {
	TichiWebURL     string `json:"tichi_web_url,omitempty" jsonschema:"required"`
	PRProcessLink   string `json:"pr_process_link,omitempty" jsonschema:"required"`
	CommandHelpLink string `json:"command_help_link,omitempty" jsonschema:"required"`
}

json generated

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "required": [
    "tichi_web_url",
    "pr_process_link",
    "command_help_link"
  ],
  "properties": {
    "tichi_web_url": {
      "type": "string"
    },
    "pr_process_link": {
      "type": "string"
    },
    "command_help_link": {
      "type": "string"
    },
  },
  "additionalProperties": false,
  "type": "object",
  "definitions": {}
}

preview

image

image

@Mini256 Mini256 added the type/feature Categorizes issue or PR as related to a new feature. label Mar 3, 2021
@Rustin170506
Copy link
Contributor

Cool!

@Mini256 Mini256 added this to To do in TiChi Mar 8, 2021
@Mini256 Mini256 added this to Q3 2021 – Jul-Sep in Community Infra Roadmap Mar 8, 2021
@ti-chi-bot
Copy link
Member

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-community-infra or Mini256.
/lifecycle stale

@Rustin170506
Copy link
Contributor

/remove-lifecycle stale

@ti-chi-bot
Copy link
Member

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-community-infra or Mini256.
/lifecycle stale

@ti-chi-bot
Copy link
Member

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-community-infra or Mini256.
/lifecycle rotten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten type/feature Categorizes issue or PR as related to a new feature.
Projects
Community Infra Roadmap
Q3 2021 – Jul-Sep
TiChi
To do
Development

No branches or pull requests

3 participants