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

Suggestion: allow leading # comments in dotslash files #31

Closed
bradzacher opened this issue Jul 26, 2024 · 2 comments
Closed

Suggestion: allow leading # comments in dotslash files #31

bradzacher opened this issue Jul 26, 2024 · 2 comments

Comments

@bradzacher
Copy link

Sometimes you need to hand-craft a dotslash config file and sometimes it's nice to add some commentary about said file.

For example I was authoring a config for gofmt and wanted to document how I got all the values to make it easy for the next person to update it in future.

Currently when I added a # line immediately after the hashbang, dotslash emitted the following:

dotslash error: problem with `/path/to/gofmt`
caused by: failed to parse DotSlash file
caused by: expected value at line 1 column 1
@dtolnay
Copy link

dtolnay commented Jul 26, 2024

The comment syntax is // and /**/. See https://dotslash-cli.com/docs/dotslash-file.

@bradzacher
Copy link
Author

Ahh I completely missed the tip block in the docs

TIP
The JSON payload in a DotSlash file is parsed with a lenient JSON parser that allows for trailing commas as well as // and /*-style comments.

I'd just assumed that the instances of // and /**/ were for docs purposed, not that they were valid syntax.

@bradzacher bradzacher closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2024
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

No branches or pull requests

2 participants