On Wed, Jun 21, 2017 at 2:13 PM, Junio C Hamano <gits...@pobox.com> wrote:
> Stefan Beller <sbel...@google.com> writes:
>
>>>>
>>>> +enum diff_symbol {
>>>> +     DIFF_SYMBOL_SEPARATOR,
>>>
>>> Drop the last comma from enum?
>>
>> I looked through out code base and for enums this is
>> actually strictly enforced, so I guess I have to play
>> by the rules here as I do not want to be the first
>> to deviate from an upheld standard.
>
> You sound like you are trying to find an excuse "not to play by the
> rules".  Don't.
>

When the rules are not yielding best results, adapting the rules
should be considered. And having no comma at the last element
produces review noise when working in a line oriented format, such
as diffs. (Add another element at the end, and then you have to
have the diff that just changes the comma)

  C99 allows a trailing comma to follow the last enumeration
  constant initializer within an enumeration type declaration,
  similar to structure member initialization lists.
  C99: ยง6.7.2.2

  For struct member lists we already do that, e.g.
  builtin/help.c: struct common_guides[]
  builtin/repack.c: struct exts[]
  ...

Yet, I will construct this series in a resend to not
have this issue.

Thanks,
Stefan

Reply via email to