Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow trailing commas in parameter and argument lists. #26644
To improve the maintainability of long argument and parameter lists, we allow the final argument or parameter to be followed by an optional comma. This allows a style where each argument or parameter is written on a line by itself, and moving one item up or down or between functions doesn't require special handling of the final item.
To be precise:
Tracking bugs for individual tasks:
It handles the cases where you move the last parameter somewhere else (leaving a dangling comma on the previous line and, maybe, missing a comma after the moved parameter in the new position), or where you add a new last parameter after the existing one (now missing a comma on the previous line).
In your example, you put the single optional parameter on a line including the braces. You can only move that line to the end of another parameter list, so there is no advantage to allowing a comma after it.
Basically the feature is for anywhere where you could write
No, it should be enabled by default.
On Tue, Jul 26, 2016, 1:18 PM Seth Ladd firstname.lastname@example.org wrote: