pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.32k stars 636 forks source link

Extend the help goal to generate a JSON schema for pants.toml file locally #18126

Open AlexTereshenkov opened 1 year ago

AlexTereshenkov commented 1 year ago

Is your feature request related to a problem? Please describe. We currently have the tooling needed to produce a JSON schema file which we submit to the schema store online. This is how any user on a supported IDE (that can speak to the schema store) would get context-sensitive autocomplete for every scope and option automatically when editing pants*.toml files. I intend to produce and publish these schema files to the store on every stable release. This improves the devX for users who are new to Pants and are exploring it as the tooling helps them editing the pants.toml. Of course anyone else who is on a stable Pants version benefits from this as well.

However, there is a group of users that may benefit from having a locally generated schema file:

To keep up with the latest representation of the options landscape, these users may want to generate the schema file locally. For this, extending the help goal would make sense.

Describe the solution you'd like There should be a way to call a Pants goal that would generate a new .json schema (for the pants*.toml files) that could be used in an IDE that supports JSON schemas.

Describe alternatives you've considered Documenting how to produce a schema file locally using existing build-support tooling without adding a goal. This is currently a two step action which involves calling the help-all goal and then munging the JSON output.

benjyw commented 1 year ago

Could this be part of help instead of a new goal?

AlexTereshenkov commented 1 year ago

Could this be part of help instead of a new goal?

That's even better, we should probably do this instead indeed!