qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] scripts/checkpatch.pl: Enforce multiline commen


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] scripts/checkpatch.pl: Enforce multiline comment syntax
Date: Fri, 10 Aug 2018 14:44:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 10/08/2018 11:41, Markus Armbruster wrote:
>> Lone "/*" or "/**": 9986 cases
>>      of which in the first column: 7617
>>      of which the first line in the file (license headers): 2834
>>      regex: ^[ \t]*/\*\*?[ \t]*$
>>
>> "/*" with the first line of the comment: 11246
>>      of which in the first column: 4985
>>      of which the first line in the file: 97
>>      regex: ^[ \t]*/\*\*?+(?:(?!\*/).)+?$
>>
>> License headers almost always have the "lone /*" format.  Apart from
>> license headers, 63% of the comments have the now-deprecated format.
>>
>> Inside functions, 73% of the comments have the now-deprecated format.
>> Outside functions it's 50-50.  That's because there are 2024 doc
>> comments, which in turn are 50% of the comments that are 1) outside the
>> functions 2) using a lone "/*".
>>
>> So my proposal, which is actually consistent with what QEMU is doing, is
>> the following:
>>
>> 1) the first line of a file should always be "/*", otherwise warn
>>
>> 2) a comment that starts with "/**" should have it on a lone line
>>
>> 3) every other multiline comment should start with
>> "/*<whitespace><something>"
> (3) is not consistent with what QEMU is doing in this case, since
> according to your data there is no consistency in what QEMU is doing.

65-35, and 75-25 inside functions (comments outside should be doc
comments so that's again a different story) is pretty consistent
actually.  So no patch would be better in your opinion?

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]