mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier.adi@gmail.com>
To: "Andy Whitcroft" <apw@shadowen.org>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: checkpatch.pl and no newline handling
Date: Mon, 12 Nov 2007 14:46:30 -0500	[thread overview]
Message-ID: <8bd0f97a0711121146w30b88cdcs8abf3f5b6bff2d14@mail.gmail.com> (raw)

the current checkpatch.pl does not reject new files that lack a
newline, yet rejects patches that fix newlines in files ... quite the
opposite of what we actually want

$ echo -n moo > no-newline
$ diff -Nu /dev/null no-newline
--- /dev/null   2007-11-10 20:02:36.248000000 -0500
+++ no-newline  2007-11-12 14:44:19.000000000 -0500
@@ -0,0 +1 @@
+moo
\ No newline at end of file
$ (diff -Nu /dev/null no-newline; echo Signed-off-by:) |
./scripts/checkpatch.pl -
Your patch has no obvious style problems and is ready for submission.

lies!

$ echo moo > newline
$ diff -u no-newline newline
--- no-newline  2007-11-12 14:44:19.000000000 -0500
+++ newline     2007-11-12 14:44:27.000000000 -0500
@@ -1 +1 @@
-moo
\ No newline at end of file
+moo
$ (diff -u no-newline newline; echo Signed-off-by:) | ./scripts/checkpatch.pl -
ERROR: patch seems to be corrupt (line wrapped?)
#5: FILE: newline:0:
\ No newline at end of file

total: 1 errors, 0 warnings, 3 lines checked
Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
-mike

             reply	other threads:[~2007-11-12 19:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12 19:46 Mike Frysinger [this message]
2007-11-13 10:18 ` Andy Whitcroft
2007-11-13 10:55 ` Andy Whitcroft

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=8bd0f97a0711121146w30b88cdcs8abf3f5b6bff2d14@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=apw@shadowen.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

all inboxes | Powered by JetHome®