-
Notifications
You must be signed in to change notification settings - Fork 233
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
Sort alphabetically entries in project.json file #19
Comments
It's loosely sorted alphabetically but since it is manually updated, it's not that easy to keep it perfect. The listing should be alphabetical though on the front-end and you're welcome to start there. We're also asking new entries be added as close to alphabetical as possible. |
Once the PRs settle down it should be easy to hack a script that will truly alphabetize it once, then you can enforce it permanently after that. Or break out each entry into its own file, as a later PR suggests would be a much easier maintenance headache. |
Yes. invidual entries will also reduce problems with commits conflicting |
#!/usr/bin/env python
import json
data=json.loads(open('projects.json','r').read())
def getKey(item):
return item['projectName']
newdata=sorted(data,key=getKey)
filename='sorted.json'
with open(filename, 'w') as fd:
json.dump(newdata, fd, indent=2) |
Covered in #100 |
Thanks! I added a question in the PR. |
Since the PR was closed, I'm commenting here. Another possibility is to use a CI system like travis, create a test that verifies the sorting in the json file, and then fail the PR if it's not alphabetical. |
I would do a second update if it's not sorted to do that automatically and
save time of submitter
Sent from mobile
El mié., 25 abr. 2018 20:20, Jason Frey <notifications@github.com> escribió:
… Since the PR was closed, I'm commenting here. Another possibility is to
use a CI system like travis, create a test that verifies the sorting in the
json file, and then fail the PR if it's not alphabetical.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATEjzSrEOI_lNVxeDyIts_091yjWs6sks5tsL6BgaJpZM4S4xQH>
.
|
My only reason against that idea is commit-history churn...It will read like "add-a-project, move-a-project, add-a-project, move-a-project" |
We'll that's not the best approach, but asking users to keep order in a big file that can be editted in parallel from several other users isn't either... probably file-per-project would have been better and will avoid conficlts and sorting will come from the static site generator (order once per web upload) |
If this is something we can add to the CI check, then I am for it. But I would put this as a low-priority need, since the maintainers of this site should be able to alphabetize during the quarterly audits. |
#70 is a better approach and would solve this issue. Closing in deference to that approach. |
it will be easier when having the file opened to check for projects if they exist or not
The text was updated successfully, but these errors were encountered: