qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/1] checkpatch: checker for comment block
@ 2018-12-13 17:55 Wainer dos Santos Moschetta
  2018-12-13 17:55 ` [Qemu-devel] [PATCH 1/1] checkpatch: check for malformed " Wainer dos Santos Moschetta
  2018-12-13 18:01 ` [Qemu-devel] [PATCH 0/1] checkpatch: checker for " Peter Maydell
  0 siblings, 2 replies; 13+ messages in thread
From: Wainer dos Santos Moschetta @ 2018-12-13 17:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: stefanha, pbonzini, thuth, ehabkost, Wainer dos Santos Moschetta

Eduardo Habkost pointed out a malformed block of comments on my
patch [1] that I had ran checkpatch.pl and no warn/error was
reported. Then I realized the script does not catch such as
case (or it had a bug).

It turns out that checkpatch.pl does not parse comment blocks (If I understood
its code correctly...). So I implemented a checker that warns about:
1. block doesn't begin on its own line.
Example:
  /* blah blah
   * and blah blah
   */

2. line in the block doesn't start with asterisk.
Example:
  /*
    foo bar
    bar foo
   */
Note: only the first occurence (i.e 'foo bar') is reported.

3. block doesn't end on its own line.
Example:
  /*
   * blah blah
   * and blah */

References:
[1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg580091.html

ps: last time I wrote Perl code was about 13 years ago. That remember me
of good times. :)

Wainer dos Santos Moschetta (1):
  checkpatch: check for malformed comment block.

 scripts/checkpatch.pl | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

-- 
2.19.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-12-14 16:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-13 17:55 [Qemu-devel] [PATCH 0/1] checkpatch: checker for comment block Wainer dos Santos Moschetta
2018-12-13 17:55 ` [Qemu-devel] [PATCH 1/1] checkpatch: check for malformed " Wainer dos Santos Moschetta
2018-12-13 18:01 ` [Qemu-devel] [PATCH 0/1] checkpatch: checker for " Peter Maydell
2018-12-13 18:07   ` Paolo Bonzini
2018-12-13 18:21     ` Peter Maydell
2018-12-13 22:23       ` Paolo Bonzini
2018-12-14  6:29         ` Markus Armbruster
2018-12-14  9:32           ` Paolo Bonzini
2018-12-14 11:20           ` Peter Maydell
2018-12-14 12:31             ` Markus Armbruster
2018-12-14 12:57               ` Peter Maydell
2018-12-14 16:11                 ` Markus Armbruster
2018-12-14 12:13   ` Wainer dos Santos Moschetta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).