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

build(schema): Add '$schema' property #4623

Merged
merged 3 commits into from
Jan 6, 2022

Conversation

caoli5288
Copy link
Contributor

Description

schema.json should allow $schema property

Checklist:

  • I have read the Contributing Guide.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@rashil2000 rashil2000 changed the base branch from master to develop January 6, 2022 08:42
@rashil2000
Copy link
Member

I have thought about this previously.

Pretty useful for autocompleting fields in Neovim, VSCode etc.

rashil2000
rashil2000 previously approved these changes Jan 6, 2022
@niheaven
Copy link
Member

niheaven commented Jan 6, 2022

Why define a $shema property in JSON Schema? I mean, what is the purpose of this field in manifest?

@caoli5288
Copy link
Contributor Author

caoli5288 commented Jan 6, 2022

Why define a $shema property in JSON Schema? I mean, what is the purpose of this field in manifest?

@niheaven Will warn "$schema property not allow here" by VSCode if use this schema explicitly.

@niheaven
Copy link
Member

niheaven commented Jan 6, 2022

Err, what is the situation of using this schema explicitly? In bucket's .vscode folder, this schema is defined to parse all bucket/*.json, and put $schema at the top of manifest json file is really strange, IMO.

@rashil2000
Copy link
Member

Err, what is the situation of using this schema explicitly?

It can help in code autocompletion, and warn about unsupported fields right there in the text editor, which can save time. It's optional anyway, so won't break anything.

In bucket's .vscode folder, this schema is defined to parse all bucket/*.json

Well, not everyone uses VSCode 😉

put $schema at the top of manifest json file is really strange, IMO.

It is the standard practice. Look at Windows Terminal's settings schema, for example: https://raw.githubusercontent.com/microsoft/terminal/release-1.11/doc/cascadia/profiles.schema.json. When you install Windows Terminal for the first time, the settings file already contains these 2 fields:

image

This helps in easy discoverability of supported features and fields.

@niheaven
Copy link
Member

niheaven commented Jan 6, 2022

Setting config file that used $schema is acceptable, I thought, but for vast manifests... It's okay for adding it here for some fallback reasons, though I hope it will never be used 🤣

Please modify the title and add changelog item for this PR.

@caoli5288
Copy link
Contributor Author

Setting config file that used $schema is acceptable, I thought, but for vast manifests... It's okay for adding it here for some fallback reasons, though I hope it will never be used 🤣

Please modify the title and add changelog item for this PR.

@niheaven I make this PR from master branch, so I can't modify the changelog. Maybe you can help me modify it?

@rashil2000
Copy link
Member

Your PR is just 4 line change, you can close this and create new one from develop to develop.

@niheaven niheaven changed the title schema.json should allow $schema property build(schema): Add '$schema' property Jan 6, 2022
@niheaven
Copy link
Member

niheaven commented Jan 6, 2022

Aha, got it. But you need to revert the recent two commits after this PR is merged in your forked repo.

@niheaven niheaven requested a review from rashil2000 January 6, 2022 17:38
@@ -8,6 +8,10 @@
- **decompress:** Fix nested Zstd archive extraction ([#4608](https://github.com/ScoopInstaller/Scoop/issues/4608))
- **shim:** Fix PS1 shim error when in different drive in PS7 ([#4614](https://github.com/ScoopInstaller/Scoop/issues/4614))

### Builds
Copy link
Member

Choose a reason for hiding this comment

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

Is Builds the appropriate category here? I'm not so sure.

Copy link
Member

Choose a reason for hiding this comment

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

I put all schema and bin changes under Builds since this has less CLI changes to end users.

@niheaven niheaven merged commit 3c5f5ff into ScoopInstaller:develop Jan 6, 2022
se35710 pushed a commit to se35710/scoop that referenced this pull request Mar 8, 2022
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.

3 participants