tool: Fixed bug causing JSON format to be broken#41565
Merged
Uh oh!
There was an error while loading. Please reload this page.
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.
The JSON format in the current version of the
config.gypifile can be broken because thepprint.pformatfunction splits the argument string into multiple lines if it is long enough and contains SpacesYou can see that function
pprint.pformataccidentally splits the string into two lines, causing the JSON format to be brokenI can think of three solutions
1 Abandon the line length limit
2 Use regular matches after
pprint.pformat3 Manually implement an appropriate print function
I chose the simplest solution for this PR and am glad to work on other solutions if the administrator thinks it is necessary