Skip to content

Remove trailing spaces in activities.json. #67

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

Merged
merged 1 commit into from
Mar 6, 2018

Conversation

dbaron
Copy link
Contributor

@dbaron dbaron commented Mar 6, 2018

I suspect editors like to strip out this trailing whitespace (e.g.,
from #53) which activities.py then readds when manipulating the JSON
(in #66). We'll avoid the churn (and annoyance) by not having the
trailing whitespace at all.

This sets the separators as described in the documentation at
https://docs.python.org/2/library/json.html to avoid trailing whitespace
when using indent.

It also consolidates the JSON-writing configuration into a single place
by creating a single JSONEncoder object.

@dbaron dbaron requested a review from adamroach March 6, 2018 20:06
@dbaron
Copy link
Contributor Author

dbaron commented Mar 6, 2018

Er, I need to fix the newline at end of file.

(Edit: fixed now, by amending commit.)

I suspect editors like to strip out this trailing whitespace (e.g.,
from mozilla#53) which activities.py then readds when manipulating the JSON
(in mozilla#66).  We'll avoid the churn (and annoyance) by not having the
trailing whitespace at all.

This sets the separators as described in the documentation at
https://docs.python.org/2/library/json.html to avoid trailing whitespace
when using indent.

It also consolidates the JSON-writing configuration into a single place
by creating a single JSONEncoder object.
Copy link
Contributor

@adamroach adamroach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for taking care of this.

@adamroach adamroach merged commit 26dd54c into mozilla:master Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants