login
Header Space

 
 

[RFC] CodeStyle: Use spaces when aligning/decorating

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <khc@...>, <bhalevy.lists@...>, <jengelh@...>
Cc: <linux-kernel@...>
Date: Tuesday, February 26, 2008 - 5:47 pm

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;
 }

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] CodeStyle: Use spaces when aligning/decorating, , (Tue Feb 26, 5:47 pm)
[PATCH] CodingStyle: multiple updates, Jan Engelhardt, (Tue Feb 26, 6:59 pm)
Re: [PATCH] CodingStyle: multiple updates, Richard Knutsson, (Wed Feb 27, 5:41 pm)
Re: [PATCH] CodingStyle: multiple updates, Stefan Richter, (Tue Feb 26, 8:39 pm)
Re: [PATCH] CodingStyle: multiple updates, Guennadi Liakhovetski, (Tue Feb 26, 7:40 pm)
Re: [PATCH] CodingStyle: multiple updates, Bernd Petrovitsch, (Wed Feb 27, 5:27 am)
Re: [PATCH] CodingStyle: multiple updates, SL Baur, (Wed Feb 27, 5:46 pm)
Re: [PATCH] CodingStyle: multiple updates, Guennadi Liakhovetski, (Wed Feb 27, 6:02 am)
Re: [PATCH] CodingStyle: multiple updates, Bernd Petrovitsch, (Wed Feb 27, 6:17 am)
Re: [PATCH] CodingStyle: multiple updates, Krzysztof Halasa, (Tue Feb 26, 7:51 pm)
Re: [PATCH] CodingStyle: multiple updates, SL Baur, (Tue Feb 26, 8:57 pm)
Re: [PATCH] CodingStyle: multiple updates, Randy Dunlap, (Wed Feb 27, 1:34 am)
Re: [PATCH] CodingStyle: multiple updates, Alexey Dobriyan, (Thu Feb 28, 5:20 pm)
Re: [PATCH] CodingStyle: multiple updates, Richard Knutsson, (Wed Feb 27, 6:02 pm)
Re: [PATCH] CodingStyle: multiple updates, SL Baur, (Wed Feb 27, 8:11 pm)
Re: [PATCH] CodingStyle: multiple updates, Richard Knutsson, (Thu Feb 28, 4:09 pm)
Re: [PATCH] CodingStyle: multiple updates, Krzysztof Halasa, (Fri Feb 29, 6:34 pm)
Re: [PATCH] CodingStyle: multiple updates, Benny Halevy, (Mon Mar 3, 12:17 pm)
Re: [PATCH] CodingStyle: multiple updates, Krzysztof Halasa, (Mon Mar 3, 5:08 pm)
Re: [PATCH] CodingStyle: multiple updates, Benny Halevy, (Tue Mar 4, 6:04 am)
Re: [PATCH] CodingStyle: multiple updates, Jan Engelhardt, (Wed Feb 27, 8:18 pm)
Re: [PATCH] CodingStyle: multiple updates, Krzysztof Halasa, (Wed Feb 27, 7:53 pm)
Re: [PATCH] CodingStyle: multiple updates, SL Baur, (Wed Feb 27, 5:33 pm)
Re: [PATCH] CodingStyle: multiple updates, Jan Engelhardt, (Tue Feb 26, 8:02 pm)
Re: [PATCH] CodingStyle: multiple updates, Stefan Richter, (Tue Feb 26, 8:42 pm)
Re: [PATCH] CodingStyle: multiple updates, Guennadi Liakhovetski, (Tue Feb 26, 8:16 pm)
Re: [RFC] CodeStyle: Use spaces when aligning/decorating, Richard Knutsson, (Tue Feb 26, 6:16 pm)
Re: [RFC] CodeStyle: Use spaces when aligning/decorating, Richard Knutsson, (Wed Feb 27, 5:47 pm)
Re: [RFC] CodeStyle: Use spaces when aligning/decorating, Richard Knutsson, (Wed Feb 27, 5:02 pm)
speck-geostationary