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

Add sort-orgs.rb script to sort organizations #53

Merged
merged 3 commits into from
May 6, 2019

Conversation

keithrbennett
Copy link
Contributor

Addresses #51.

Organizations are in random sort order making them more difficult to find. This will become more and more of an issue as the list grows.

When this script is run, it will sort the organizations by name case insensitively, overwriting the original content with the sorted content.

To test that data has not been corrupted during sorting, it creates and compares sets with both original and sorted arrays, aborting before overwriting if the sets are not equal.

@lewispb
Copy link
Owner

lewispb commented May 4, 2019

Thanks for this @keithrbennett!

I like the simplicity of editing the yaml file without even checking out the code locally, by simply editing right within GitHub. So I'm just trying to think how this could fit into that workflow? What do you think?

@keithrbennett
Copy link
Contributor Author

Sorry, I should have mentioned the suggested workflow.

I was thinking this would be run only on an as needed basis. So, for example, we/you could run it once at this point in time and commit the file. If you could include in the readme a suggestion to add new entries in case insensitive order, then theoretically we might never need to run the script again.

The script could be run from time to time, and it would say if a sort was needed or not.

@matthewmayer
Copy link
Contributor

If the file is sorted it means git conflicts are less likely as it avoids people always appending to the end of the list.

@lewispb
Copy link
Owner

lewispb commented May 6, 2019

Agreed, good point @matthewmayer

Copy link
Owner

@lewispb lewispb left a comment

Choose a reason for hiding this comment

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

Thanks!

@lewispb lewispb merged commit b9718af into lewispb:master May 6, 2019
@lewispb lewispb mentioned this pull request May 6, 2019
@keithrbennett keithrbennett deleted the sort-orgs-by-name branch May 6, 2019 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants