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

Allow asv.conf.jsonc file by default #1420

Merged
merged 3 commits into from
Aug 12, 2024
Merged

Conversation

lucascolley
Copy link
Contributor

In SciPy, we have lots of comments in our asv.conf.json file. But comments are not allowed in JSON files (hence developers on GitHub or VSCode see lots of red highlighting).

This PR allows the config file to be named asv.conf.jsonc(a JSON with comments file), without having to pass the name to --config.

asv/config.py Outdated Show resolved Hide resolved
@lucascolley
Copy link
Contributor Author

@HaoZeke @mattip does this sounds like something you'd be happy to support by default? Or do you think comments in the config file is a niche use case?

Copy link
Member

@HaoZeke HaoZeke left a comment

Choose a reason for hiding this comment

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

Is the .jsonc file extension widely known / used? If not I don't know that this would make sense to explicitly search for from an ASV perspective, given that this is mostly run in CI anyway and since passing the file works via --config

@lucascolley
Copy link
Contributor Author

lucascolley commented Aug 10, 2024

500ish stars on Microsoft's parser (https://github.com/microsoft/node-jsonc-parser), so not widely known, but also not niche IMO.

My reason for opening this PR is that appending c to the file extension appears to be the idiomatic solution to all the red highlighting that appears on the GitHub interface. Unless I am missing a setting.

But no worries if this seems like more hassle than it is worth - I was just hoping that I could change to jsonc downstream without breaking peoples' local asv invocations.


The same applies to code blocks in conversation messages:

json:

// a comment

jsonc:

// a comment

asv/config.py Outdated Show resolved Hide resolved
@HaoZeke
Copy link
Member

HaoZeke commented Aug 11, 2024

500ish stars on Microsoft's parser (microsoft/node-jsonc-parser), so not widely known, but also not niche IMO.

My reason for opening this PR is that appending c to the file extension appears to be the idiomatic solution to all the red highlighting that appears on the GitHub interface. Unless I am missing a setting.

But no worries if this seems like more hassle than it is worth - I was just hoping that I could change to jsonc downstream without breaking peoples' local asv invocations.

The same applies to code blocks in conversation messages:

json:

// a comment

jsonc:

// a comment

OK then I'd say it'd be in scope, since anything to make using ASV more ergonomic is a win, left some suggestions for a refactor though.

@lucascolley
Copy link
Contributor Author

let me know if this is what you had in mind with Path!

asv/config.py Outdated Show resolved Hide resolved
asv/config.py Outdated Show resolved Hide resolved
asv/config.py Outdated Show resolved Hide resolved
Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
@HaoZeke HaoZeke merged commit 7c04d4e into airspeed-velocity:main Aug 12, 2024
13 checks passed
@lucascolley
Copy link
Contributor Author

thanks @HaoZeke !

Let me know if I can help make an asv release happen, btw - I would like to patch SciPy once this is released.

@HaoZeke
Copy link
Member

HaoZeke commented Aug 12, 2024

thanks @HaoZeke !

Let me know if I can help make an asv release happen, btw - I would like to patch SciPy once this is released.

Sure, I'm planning to cut a new release today, and add some documentation on how we manage them and what the tasks generally are (fairly standard but good to have written down). Maybe a REL issue or something.

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.

2 participants