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

Update the JSON schema #4486

Closed
firelizzard18 opened this issue Mar 11, 2024 · 8 comments · Fixed by #4487
Closed

Update the JSON schema #4486

firelizzard18 opened this issue Mar 11, 2024 · 8 comments · Fixed by #4487
Labels
area: JSON schema enhancement New feature or improvement

Comments

@firelizzard18
Copy link
Contributor

Your feature request related to a problem? Please describe.

#4437 adds a new kind of plugin. The published JSON schema needs to be updated. Specifically the current schema does not allow linters-settings.custom.{name}.path to be unset. It also doesn't have any of the new properties, but I don't care about that as much as the angry red squiggles from the supposedly missing property.

Describe the solution you'd like.

The schema to be updated.

Describe alternatives you've considered.

N/A

Additional context.

No response

@firelizzard18 firelizzard18 added the enhancement New feature or improvement label Mar 11, 2024
@bombsimon
Copy link
Member

bombsimon commented Mar 11, 2024

The schema comes from #1453 and is not written by us. I don't really know the process of updating it, I assume PRs to https://github.com/SchemaStore/schemastore?

We might also want to consider a schema file for .custom-gcl.reference.yml which is a separate file.

EDIT: Ah I guess this is how it's updated 😃

EDIT2: The schema is designed to match the latest release so users don't get information about non released configuration. Once v1.57.0 is released with the new plugin system we can update the schema.

@ldez
Copy link
Member

ldez commented Mar 11, 2024

I update the JSON schema after each release https://github.com/SchemaStore/schemastore/pulls?q=is%3Apr+author%3Aldez+is%3Aclosed

As I said some other issues related to this topic, I'm working on several things about JSON schema.

One of them is to move the schema from the schemastore to our repo like goreleaser:
https://github.com/SchemaStore/schemastore/blob/master/src/api/json/catalog.json#L2108-L2123

If the schema is inside our repo, then we will be able to do the same thing as .golangci.next.reference.yml/.golangci.reference.yml.

I think we will not ask contributors to update this schema because the syntax is not simple.

I need more time to think about a better solution.

@ldez
Copy link
Member

ldez commented Mar 11, 2024

About the .custom-gcl.yml JSON schema, I already created one, but I want to "resolve" the move and the management of the golangci-lint schema first.
mygcl.schema.json

@ldez
Copy link
Member

ldez commented Mar 11, 2024

@bombsimon what do you think about my idea to move the JSON schema inside our repo?

@bombsimon
Copy link
Member

@bombsimon what do you think about my idea to move the JSON schema inside our repo?

Yes, I absolutely think we should do that and I thought that was part of the goal with #1453 as well since it was offered. Even better if it's a solution to reference the schema in our repository to not have to update upstream!

@firelizzard18
Copy link
Contributor Author

I had assumed it was in this repo, it makes sense that you'd only update it for releases. I was eager to update golangci-lint and remove my plugin workaround hacks.

I assume there is a Go type that corresponds to the schema? It might be feasible to automatically generate that via introspection (e.g. reflection or reading the source and go/types). Besides all of these JSON schema packages I wrote a JSON-schema code generator for Yaegi though I'm honestly not sure how usable that is. It was very purpose-specific.

@ldez
Copy link
Member

ldez commented Mar 11, 2024

I assume there is a Go type that corresponds to the schema? It might be feasible to automatically generate that via introspection (e.g. reflection or reading the source and go/types).

I answered to this question here: #1453 (comment)

@ldez
Copy link
Member

ldez commented Mar 11, 2024

So I will move the schema 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: JSON schema enhancement New feature or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants