FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: sort contributors alphabetically case-insensitively with login fallback by vjymisal0 · Pull Request #531 · all-contributors/cli · GitHub

fix: sort contributors alphabetically case-insensitively with login fallback - #531

Open
vjymisal0 wants to merge 1 commit into
all-contributors:mainfrom
vjymisal0:fix/case-insensitive-contributor-sort
Open

fix: sort contributors alphabetically case-insensitively with login fallback#531
vjymisal0 wants to merge 1 commit into
all-contributors:mainfrom
vjymisal0:fix/case-insensitive-contributor-sort

Conversation

vjymisal0 commented Aug 28, 2026
edited
Loading

Copy link
Copy Markdown

Description

Fixes #370

Currently, when \contributorsSortAlphabetically: true\ is configured, sorting is performed directly on \�.name\ using default \localeCompare. This leads to:

  1. Capitalized names (A-Z) and lowercase names (a-z) sorting into separate clusters rather than a natural, case-insensitive alphabetical sequence.
  2. Contributor records that lack an explicit
    ame\ property sorting incorrectly as empty strings instead of falling back to their \login.

Changes Made

  • Updated \generateContributorsList\ in src/generate/index.js to sort with \localeCompare(..., undefined, { sensitivity: 'base' })\ with fallback to standard \localeCompare.
  • Added fallback to contributor \login\ when
    ame\ is not present, matching the display fallback in src/generate/format-contributor.js.
  • Added comprehensive unit tests in src/generate/tests/index.js validating case-insensitive sorting and missing name fallbacks.
  • Updated path assertions in src/util/tests/git.js to ensure cross-platform compatibility across Windows, macOS, and Linux.

Testing

  • Ran
    pm test\ with 100% tests passing (15 test files, 116 tests).
  • Verified ESLint and Prettier formatting checks passed.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

contributorsSortAlphabetically alphabetical sort shouldn't be case sensitive

1 participant


Back | FazBrowse Home | New Git URL