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

feat(alpha-sort): Add a parameter contributorsSortAlphabetically #249

Merged
merged 1 commit into from
Feb 23, 2020
Merged

feat(alpha-sort): Add a parameter contributorsSortAlphabetically #249

merged 1 commit into from
Feb 23, 2020

Conversation

alexwlchan
Copy link
Contributor

@alexwlchan alexwlchan commented Feb 21, 2020

This parameter allows the user to sort the list of contributors in
alphabetical order of their name.

What: This adds a new CLI flag --contributorsSortAlphabetically/config option contributorsSortAlphabetically that allows you to display the list of contributors in alphabetical order (based on name).

Why: This is a feature request that's come up a couple of times, e.g. all-contributors/all-contributors#225

How: The order of contributors is preserved in the JSON file. When the list is rendered, check a contributorsSortAlphabetically option (defaulted to false, to preserve existing behaviour) to decide whether to sort the list of contributors before turning into HTML.

Standard TDD: write a test for the new config option, check it fails, edit the code, check the test passes.

For the CLI, I ran it in the root of this repo to see that it would sort in alphabetical order or order-of-being added, depending on what value I passed.

This needs to be added to the docs in https://github.com/all-contributors/all-contributors/blob/master/docs/cli/configuration.md, but I didn't want to do that until I had approval for the feature and the name of the option.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

This parameter allows the user to sort the list of contributors in
alphabetical order of their name.
@Berkmann18 Berkmann18 requested a review from a team February 22, 2020 21:54
src/cli.js Show resolved Hide resolved
Copy link
Collaborator

@jakebolam jakebolam 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. Are you able to open a PR for the docs as well?

@alexwlchan
Copy link
Contributor Author

@jakebolam Done! all-contributors/all-contributors#367

@Berkmann18 Berkmann18 merged commit b3d0995 into all-contributors:master Feb 23, 2020
@all-contributors-release-bot
Copy link
Member

🎉 This PR is included in version 6.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

None yet

4 participants