-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Stanza.WriteTo: Sort extra fields alphabetically #803
Stanza.WriteTo: Sort extra fields alphabetically #803
Conversation
This makes the output deterministic. This is important to me as I am using `Packages` index files as a kind of lockfile and committing it to my git repository. Without this we get a lot of noise in the diff whenever the file is regenerated because [go randomises map iteration order][1]. [1]: https://nathanleclaire.com/blog/2014/04/27/a-surprising-feature-of-golang-that-colored-me-impressed/
My measly contribution hardly merits it but it's a requirement in `CONTRIBUTING.md`.
I've not yet written a test for this change. I was hoping to expand on existing tests for |
Build passed on Travis, but seems to have failed to report the status back to github. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 lgtm
I've submitted #807 which fixes linting errors (should allow this PR to build). |
Codecov Report
@@ Coverage Diff @@
## master #803 +/- ##
==========================================
- Coverage 64.11% 64.09% -0.02%
==========================================
Files 51 51
Lines 6501 6512 +11
==========================================
+ Hits 4168 4174 +6
- Misses 1825 1831 +6
+ Partials 508 507 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #803 +/- ##
==========================================
+ Coverage 64.19% 64.23% +0.03%
==========================================
Files 51 51
Lines 6508 6514 +6
==========================================
+ Hits 4178 4184 +6
Misses 1825 1825
Partials 505 505
Continue to review full report at Codecov.
|
Description of the Change
This makes the output of
Stanza.WriteTo
deterministic. This is important to me as I am usingPackages
index files as a kind of lockfile and committing it to my git repository. Without this we get a lot of noise in the diff whenever the file is regenerated because go randomises map iteration order.Checklist
man page updated (if applicable)- N/Abash completion updated (if applicable)- N/Adocumentation updated- N/AAUTHORS