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

Support JSONC in json module #255

Open
ashi009 opened this issue May 31, 2023 · 1 comment
Open

Support JSONC in json module #255

ashi009 opened this issue May 31, 2023 · 1 comment

Comments

@ashi009
Copy link

ashi009 commented May 31, 2023

Description of the feature request:

It would be great to support JSONC format in json module.

json.decode(str, allow_comments = True)

or

jsonc.decode(str)

What underlying problem are you trying to solve with this feature?

With the adoption of bzlmod, and bazelbuild/bazel#14632. Maintaining all the extension configs in MODULE.bazel becomes harder and harder.

Therefore, as a rule author, I'd love to provide a way for users to offload such configs in a separate file. And most importantly I want this file to be somewhat ergonomic to work with. For now, the only natively supported data format is JSON. However, JSON is not a great format for human maintained data, where comments and trailing commas are appreciated. On the other hand, JSONC solves those issues perfectly while not introducing lots of complexity to the parser.

Which operating system are you running Bazel on?

macOS

What is the output of bazel info release?

6.2.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@meteorcloudy meteorcloudy transferred this issue from bazelbuild/bazel Jun 6, 2023
@stepancheg
Copy link
Contributor

This is a repo for starlark spec, not specific starlark implementation (even if this repo sits in bazel org).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants