From: bernd@petrovitsch.priv.at (Bernd Petrovitsch)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Tool for automatic style of coding guidelines
Date: Sat, 28 Jan 2012 12:40:01 +0100 [thread overview]
Message-ID: <1327750801.17434.10.camel@thorin> (raw)
In-Reply-To: <CAGpXXZJj=sbTjjSpf5B0pXyPKNvZR1kNs03OpaCZ2bt52dqMuQ@mail.gmail.com>
On Fre, 2012-01-27 at 13:55 -0500, Greg Freemyer wrote:
[...]
> BUT, can checkpatch actually modify the files? I think I've only used
> it to identify issues, not resolve them.
Yup, and one wants actually no automatic repair in general because the
main goal of (the) coding style guide(s) is to keep a common "layout" so
that the code is easily readable and understandable and *not* to follow
some hard-coded rules.
Yes, for "spaces to tabs" one can do that (and actually emacsens can do
it with "indent-region" etc. without much hassle and it shouldn't be
that hard with global-find-and-replace in any decent editor).
So it's OK to "break" rules if the source gets obscured by following it.
The prime example is probably the line length where it doesn't get
better in any way (au contraire IMHO - it gets much worse) if
printk("this is a very long format string and it is here for good reason");
is split on 2 lines.
And
if (some_condition)
x = 1;
else {
x = 4711;
y = 45;
}
also hurts my eyes.
Bernd
--
Bernd Petrovitsch Email : bernd at petrovitsch.priv.at
LUGA : http://www.luga.at
next prev parent reply other threads:[~2012-01-28 11:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-27 12:20 Tool for automatic style of coding guidelines Prajosh Premdas
2012-01-27 14:18 ` Philipp Ittershagen
2012-01-27 18:55 ` Greg Freemyer
2012-01-28 11:40 ` Bernd Petrovitsch [this message]
2012-01-27 18:15 ` Greg KH
2012-01-28 18:35 ` Adil Mujeeb
2012-01-30 15:06 ` Prajosh Premdas
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=1327750801.17434.10.camel@thorin \
--to=bernd@petrovitsch.priv.at \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).