Skip to content

checkpatch: Add ability to insert/delete lines

Joe Perches lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2checkpatch: Add an index variable for fixed linesscripts/checkpatch.pl+60 -540 replies
2/2checkpatch: Add ability to insert and delete lines to patch/filescripts/checkpatch.pl+130 -114 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] checkpatch: Add ability to insert/delete lines

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(-)
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty