LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC] CodeStyle: Use spaces when aligning/decorating
@ 2008-02-26 21:47 ricknu-0
  2008-02-26 21:54 ` Randy Dunlap
  0 siblings, 1 reply; 33+ messages in thread
From: ricknu-0 @ 2008-02-26 21:47 UTC (permalink / raw)
  To: khc, bhalevy.lists, jengelh; +Cc: linux-kernel

Relaxing the 'tab = 8 character', which leads to 'don't tab the alignment'.
By only using tabs for indentation, we solidify it as a 'logical indentation'.

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
---
To'ed the people who showed interest in the (apparently not so new)
question/suggestion of not using tabs when aligning.
If this looks ok, then checkpatch.pl is next...


diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 6caa146..1b3f448 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -15,10 +15,8 @@ Anyway, here goes:
 
 	 	Chapter 1: Indentation
 
-Tabs are 8 characters, and thus indentations are also 8 characters.
-There are heretic movements that try to make indentations 4 (or even 2!)
-characters deep, and that is akin to trying to define the value of PI to
-be 3.
+This project is recommended to be viewed with a tab-width of 8 characters
+(and other code).
 
 Rationale: The whole idea behind indentation is to clearly define where
 a block of control starts and ends.  Especially when you've been looking
@@ -86,13 +84,15 @@ substantially to the right. The same applies to function
headers with a long
 argument list. Long strings are as well broken into shorter strings. The
 only exception to this is where exceeding 80 columns significantly increases
 readability and does not hide information.
+As this falls under alignments, only use tabs to indent it to the parents
+level and then space in the rest.
 
 void fun(int a, int b, int c)
 {
 	if (condition)
 		printk(KERN_WARNING "Warning this is a long printk with "
-						"3 parameters a: %u b: %u "
-						"c: %u \n", a, b, c);
+		                    "3 parameters a: %u b: %u "
+		                    "c: %u \n", a, b, c);
 	else
 		next_statement;
 }


^ permalink raw reply	[flat|nested] 33+ messages in thread
[parent not found: <a1fQN-352-63@gated-at.bofh.it>]

end of thread, other threads:[~2008-03-04 10:06 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-26 21:47 [RFC] CodeStyle: Use spaces when aligning/decorating ricknu-0
2008-02-26 21:54 ` Randy Dunlap
2008-02-26 22:16   ` Richard Knutsson
2008-02-27  0:14     ` Benny Halevy
2008-02-27 21:02       ` Richard Knutsson
2008-02-27 21:33     ` Bob Copeland
2008-02-27 21:47       ` Richard Knutsson
2008-02-26 22:59   ` [PATCH] CodingStyle: multiple updates Jan Engelhardt
2008-02-26 23:40     ` Guennadi Liakhovetski
2008-02-26 23:51       ` Krzysztof Halasa
2008-02-27  0:02         ` Jan Engelhardt
2008-02-27  0:16           ` Guennadi Liakhovetski
2008-02-27  0:42           ` Stefan Richter
2008-02-27  0:57         ` SL Baur
2008-02-27  5:34           ` Randy Dunlap
2008-02-27 21:33             ` SL Baur
2008-02-27 22:02             ` Richard Knutsson
2008-02-27 23:53               ` Krzysztof Halasa
2008-02-28  0:11               ` SL Baur
2008-02-28  0:18                 ` Jan Engelhardt
2008-02-28 20:09                 ` Richard Knutsson
2008-02-29 22:34                   ` Krzysztof Halasa
2008-03-03 16:17                     ` Benny Halevy
2008-03-03 21:08                       ` Krzysztof Halasa
2008-03-04 10:04                         ` Benny Halevy
2008-02-28 21:20             ` Alexey Dobriyan
2008-02-27  9:27       ` Bernd Petrovitsch
2008-02-27 10:02         ` Guennadi Liakhovetski
2008-02-27 10:17           ` Bernd Petrovitsch
2008-02-27 21:46         ` SL Baur
2008-02-27  0:39     ` Stefan Richter
2008-02-27 21:41     ` Richard Knutsson
     [not found] <a1fQN-352-63@gated-at.bofh.it>
     [not found] ` <a1g0n-3hn-17@gated-at.bofh.it>
     [not found]   ` <a1h64-5gC-25@gated-at.bofh.it>
     [not found]     ` <a1hII-67t-5@gated-at.bofh.it>
     [not found]       ` <a1hSu-6j3-13@gated-at.bofh.it>
     [not found]         ` <a1iOy-7Mq-37@gated-at.bofh.it>
     [not found]           ` <a1nbp-6hE-5@gated-at.bofh.it>
     [not found]             ` <a1CDx-5ZM-9@gated-at.bofh.it>
     [not found]               ` <a1EFk-Mt-9@gated-at.bofh.it>
     [not found]                 ` <a1Yl9-6NF-161@gated-at.bofh.it>
     [not found]                   ` <a2m3J-2EX-19@gated-at.bofh.it>
2008-03-01  0:10                     ` Bodo Eggert

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).