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 JSON and YAML option fromfiles. #7500

Merged
merged 3 commits into from Apr 6, 2019

Conversation

Projects
None yet
3 participants
@benjyw
Copy link
Contributor

commented Apr 4, 2019

For cases when eval-able python is burdensome or inappropriate as a textual format.

@benjyw benjyw requested review from stuhood and illicitonion Apr 4, 2019

@Eric-Arellano
Copy link
Contributor

left a comment

Good idea!

It would be great to update the docs to mention that you can use JSON or YAML as an alternative to .ini files: https://www.pantsbuild.org/options.html.

@benjyw

This comment has been minimized.

Copy link
Contributor Author

commented Apr 5, 2019

To clarify, this does not replace .ini files. It merely allows individual values for options with fromfile=True to be parsed as JSON or YAML, instead of being read verbatim (and later eval'd as python).

@benjyw

This comment has been minimized.

Copy link
Contributor Author

commented Apr 5, 2019

Looks like we have no documentation of fromfile at all!

I'll hold off on that until we rule on #7507

@illicitonion
Copy link
Contributor

left a comment

Works for me :) Thanks!

benjyw added some commits Apr 4, 2019

Support JSON and YAML option fromfiles.
For cases when eval'd python is burdensome or inappropriate.
Python2 doesn't have JSONDecodeError.
It raises ValueError, and Python3's JSONDecodeError is
just a ValueError with a JSON-specific error message, so
might as well just catch ValueError in all cases.

@benjyw benjyw force-pushed the benjyw:yaml_option_files branch from 7d4700b to 78941e6 Apr 5, 2019

@benjyw benjyw merged commit 24b7738 into pantsbuild:master Apr 6, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@benjyw benjyw deleted the benjyw:yaml_option_files branch Apr 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.