All of lore.kernel.org
 help / color / mirror / Atom feed
* + checkpatch-fix-regressions-in-fix-handling-of-leading-spaces.patch added to -mm tree
@ 2010-08-18 20:25 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2010-08-18 20:25 UTC (permalink / raw)
  To: mm-commits; +Cc: apw


The patch titled
     checkpatch: fix regressions in "fix handling of leading spaces"
has been added to the -mm tree.  Its filename is
     checkpatch-fix-regressions-in-fix-handling-of-leading-spaces.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: checkpatch: fix regressions in "fix handling of leading spaces"
From: Andy Whitcroft <apw@canonical.com>

The patch "checkpatch: fix handling of leading spaces" added checks for
leading spaces on lines, but this introduces regressions.  Firstly it does
not correctly detect when we are in a comment.  Secondly it does not allow
for preprocessor command spacing.  Finally it does not allow for label
indentation which is required to be less than one tab.  Fix these up:

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 scripts/checkpatch.pl |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff -puN scripts/checkpatch.pl~checkpatch-fix-regressions-in-fix-handling-of-leading-spaces scripts/checkpatch.pl
--- a/scripts/checkpatch.pl~checkpatch-fix-regressions-in-fix-handling-of-leading-spaces
+++ a/scripts/checkpatch.pl
@@ -1459,10 +1459,13 @@ sub process {
 		}
 
 # check for spaces at the beginning of a line.
-		if ($rawline =~ /^\+ / && $rawline !~ /\+ +\*/)  {
+# Exceptions:
+#  1) within comments
+#  2) indented preprocessor commands
+#  3) hanging labels
+		if ($rawline =~ /^\+ / && $line !~ /\+ *(?:$;|#|$Ident:)/)  {
 			my $herevet = "$here\n" . cat_vet($rawline) . "\n";
-			WARN("please, no space for starting a line, \
-				excluding comments\n" . $herevet);
+			WARN("please, no spaces at the start of a line\n" . $herevet);
 		}
 
 # check we are in a valid C source file if not then ignore this hunk
_

Patches currently in -mm which might be from apw@canonical.com are

checkpatch-fix-regressions-in-fix-handling-of-leading-spaces.patch
checkpatch-types-may-sit-on-a-line-on-their-own.patch
checkpatch-suggest-cleanpatch-and-cleanfile-when-appropriate.patch
checkpatch-ensure-we-do-not-collapse-bracketed-sections-into-constants.patch
checkpatch-handle-casts-better-fixing-false-categorisation-of-as-binary.patch
checkpatch-returning-errno-typically-should-be-negative.patch
checkpatch-add-check-for-space-after-struct-union-and-enum.patch
checkpatch-simplify-and-consolidate-missing-space-after-checks.patch
checkpatch-ensure-kconfig-help-checks-only-apply-when-we-are-adding-help.patch
checkpatch-check-for-incorrect-permissions.patch
checkpatch-add-additional-attribute-defines.patch
checkpatch-update-copyright-dates.patch
checkpatch-clean-up-structure-definition-macro-handline.patch
checkpatch-handle-export_symbol-for-device_attr-and-similar.patch
checkpatch-statement-block-context-analyser-should-look-at-sanitised-lines.patch
checkpatch-version-031.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-18 20:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-18 20:25 + checkpatch-fix-regressions-in-fix-handling-of-leading-spaces.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.