Repository navigation
fix(pathmeta): quote string attributes that look like numbers when saving vfox.toml - #756
Merged
linghengqian merged 1 commit intoNov 13, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #756 +/- ##
==========================================
+ Coverage 56.21% 56.26% +0.04%
==========================================
Files 115 115
Lines 8576 8574 -2
==========================================
+ Hits 4821 4824 +3
+ Misses 3291 3287 -4
+ Partials 464 463 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Tool attributes in
.vfox.tomlare strings, but when the file is saved some of them are written as bare TOML values and read back as something else:dist = "17.0"is saved asdist = 17.0and reloaded as"17""1.50"becomes"1.5","1e3"becomes"1000","+5"becomes"5","nan"becomes"NaN""007"is saved asdist = 007, which is invalid TOML, so the file can no longer be loadedAny command that loads and re-saves the config (for example
vfox usefor another SDK) rewrites the other tools' attributes this way.Cause
formatAttributeValueininternal/pathmeta/vfox_toml.gowrote a value bare wheneverstrconv.ParseIntorstrconv.ParseFloataccepted it. Those accept more than TOML does (leading zeros,+,_,nan,inf) and do not preserve the original text.Fix
Write only
true/falseand canonical integers (value equalsFormatInt(ParseInt(value))) bare; quote everything else. The float branch is dropped, since a float cannot be reproduced as the same string.Testing
TestVfoxToml_StringAttrRoundTrip, which saves and reloads attributes such as17.0,1.50,007,1e3,1_000,+5,nan,inf. It fails before the change and passes after.go test ./...passes.