stringham added a comment. I think we should have the option whether or not a trailing comma is preset for a few reasons:
1. clang-format doesn't support enforcing adding trailing commas 2. trailing commas aren't always supported (if you use the rest operator) - `Uncaught SyntaxError: Rest parameter must be last formal parameter` 3. if you break before the opening paren, treating the surrounding parens as a "block" helps the developer match up the parens. false: longFunctionCall(new longClassNameBeingInitialized( param1, param2, param3, param4, param5)); true: longFunctionCall(new longClassNameBeingInitialized( param1, param2, param3, param4, param5 )); also happens for function calls like this: false: this.myList = [ param1, functionCall(param) .chainedCall( longparam1, function(foo) { return calculateSomething(foo); }), param3, ]; true: this.myList = [ param1, functionCall(param) .chainedCall( longparam1, function(foo) { return calculateSomething(foo); } ), param3, ]; can't put a trailing comma with the rest operator false: class MyClass { constructor( param1, param2, ...args) { this.p1 = param1; } } true: class MyClass { constructor( param1, param2, ...args ) { this.p1 = param1; } } https://reviews.llvm.org/D33029 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits