public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Whitcroft <apw@canonical.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] checkpatch: Add ability to insert/delete lines
Date: Tue,  8 Jul 2014 10:53:34 -0700	[thread overview]
Message-ID: <cover.1404840958.git.joe@perches.com> (raw)

Creating patches for files or modifying existing patches can be a bit
easier when lines need to be added or deleted.

Here's a start at that.

There are still false positives for things like

For example, this can be useful for staging where blank lines after
declarations are desired.

For instance: (using --strict also enables multiple blank line removals)

for a single file:

$ ./scripts/checkpatch.pl -f --fix-inplace --strict --types=line_spacing \
  drivers/staging/android/binder.c
$ git diff --shortstat drivers/staging/android/binder.c
 1 file changed, 4 insertions(+), 4 deletions(-)

for all files in drivers/staging:

$ git ls-files "drivers/staging/*.[ch]" | \
  xargs ./scripts/checkpatch.pl -f --fix-inplace --strict --types=line_spacing
$ git diff --shortstat drivers/staging/
 1028 files changed, 2513 insertions(+), 3540 deletions(-)

There are still some false positives like:

drivers/staging/ced1401/use14_ioc.h where an old Microsoftism for FAR is used.
The test adds an unnecessary blank line there.

So, as ever, this is just a convenience function.
Don't rely on it.
  
Joe Perches (2):
  checkpatch: Add an index variable for fixed lines
  checkpatch: Add ability to insert and delete lines to patch/file

 scripts/checkpatch.pl | 255 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 190 insertions(+), 65 deletions(-)

-- 
1.8.1.2.459.gbcd45b4.dirty


             reply	other threads:[~2014-07-08 17:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 17:53 Joe Perches [this message]
2014-07-08 17:53 ` [PATCH 1/2] checkpatch: Add an index variable for fixed lines Joe Perches
2014-07-08 17:53 ` [PATCH 2/2] checkpatch: Add ability to insert and delete lines to patch/file Joe Perches
2014-07-08 20:24   ` Andrew Morton
2014-07-08 20:57     ` Joe Perches
2014-07-08 21:07       ` Andrew Morton
2014-07-08 21:24         ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1404840958.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox