Task sorting is unreliable when using the verbose option
- Dominant language
- JavaScript
- Stars
- 12.2k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
Hi
Inside grunt.js there are the following lines
// Display available tasks (for shell completion, etc).
_tasks = Object.keys(grunt.task._tasks).sort();
While this would be correct in the case of the english alphabet, for special characters from all over the world it might produce unexpected an unexpected behaviour. The fix is using localeCompare.
// Display available tasks (for shell completion, etc).
_tasks = Object.keys(grunt.task._tasks).sort((a, b) => a.localeCompare(b));
If needed, I could open a PR on this.
Thanks!
Contributor guide
Research direction
Start in grunt.js at the task-list sorting code shown in the issue. Check how verbose task output handles task names containing international or special characters, and consider the work done when those names are ordered consistently using locale-aware comparison.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 62/100