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

Remove trailing whitespace from golden files #9827

Merged
merged 2 commits into from
Dec 28, 2018

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Dec 28, 2018

When system tests are run with the GENERATE environment variable set, we regenerate golden files used by these tests. To do this we use the Python json.dump function, which adds trailing whitespaces when it is called with the indent argument (which we do). From the Python docs at https://docs.python.org/2/library/json.html:

Note Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this.

Per the suggestion in the docs, this change adds the separators argument as well, to avoid generating trailing whitespace.

This PR also regenerates all golden files with the new regeneration code.

@ycombinator ycombinator force-pushed the no-trailing-whitespace branch from e622d40 to 5552cfc Compare December 28, 2018 16:10
When system tests are run with the `GENERATE` environment variable set, we regenerate golden files used by these tests. To do this we use the Python `json.dump` function, which adds trailing whitespaces when it is called with the `indent` argument (which we do). From the Python docs at https://docs.python.org/2/library/json.html:

> Note Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this.

Per the suggestion in the docs, this change adds the `separators` argument as well, to avoid generating trailing whitespace.
@ycombinator ycombinator force-pushed the no-trailing-whitespace branch from 5552cfc to 3c656e3 Compare December 28, 2018 17:44
@ycombinator
Copy link
Contributor Author

jenkins, test this

@ycombinator ycombinator merged commit bb92226 into elastic:master Dec 28, 2018
ycombinator added a commit that referenced this pull request Dec 29, 2018
#9832)

Cherry-pick of PR #9827 to 6.x branch. Original message: 

When system tests are run with the `GENERATE` environment variable set, we regenerate golden files used by these tests. To do this we use the Python `json.dump` function, which adds trailing whitespaces when it is called with the `indent` argument (which we do). From the Python docs at https://docs.python.org/2/library/json.html:

> Note Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this.

Per the suggestion in the docs, this change adds the `separators` argument as well, to avoid generating trailing whitespace.

This PR also regenerates all golden files with the new regeneration code.
@ycombinator ycombinator deleted the no-trailing-whitespace branch December 25, 2019 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants