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

spruce merge removes underscores (during grab) #358

Open
matthewcosgrove opened this issue Mar 18, 2022 · 2 comments
Open

spruce merge removes underscores (during grab) #358

matthewcosgrove opened this issue Mar 18, 2022 · 2 comments

Comments

@matthewcosgrove
Copy link

matthewcosgrove commented Mar 18, 2022

Some old scripts using "spruce grab" just encountered a config with underscores for the first time where spruce just removed them and it causes the script to fail

Re-produced in the playground here when doing grab: https://play.spruce.cf/#bc2194107376bb46e672763321d0e896

Then noticed it is actually happening during the merge: https://play.spruce.cf/#dcb7aac2b37604ff4930e36c84726812

Is this expected behaviour? Any workarounds?

@matthewcosgrove matthewcosgrove changed the title grab removes underscores spruce merge removes underscores (during grab) Mar 18, 2022
@geofffranks
Copy link
Owner

10_0_0_1 is actually a valid yaml number (underscores can be used instead of commas). If you quote the value, this issue should go away:

https://play.spruce.cf/#8a31fce07eb472288502aaee8d41461f

@sorenisanerd
Copy link
Contributor

It's part of the YAML spec: https://yaml.org/type/int.html

It's surprisingly common. Java, for one, does the same thing:
https://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html

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

3 participants