[RFC PATCH wayland 3/3] contributing: reformat code examples

Pekka Paalanen ppaalanen at gmail.com
Wed Jun 13 13:32:24 UTC 2018


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Before, the code examples looked good in the file, but a hard tab was
rendered as 4 spaces by Gitlab.

Now, Gitlab renders the code examples like they should look, with 8-wide
tabs, but the file looks awful.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---

Is it better with or without this patch?

You can see the result in:
https://gitlab.freedesktop.org/pq/wayland/blob/61f169d24af699643708d22f728890151994d05e/CONTRIBUTING.md

 CONTRIBUTING.md | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b22fdef..0c2990e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -134,19 +134,19 @@ try to follow the rules below.
 static int
 my_function(void)
 {
-	int a = 0;
-
-	if (a)
-		b();
-	else
-		c();
-
-	if (a) {
-		b();
-		c();
-	} else {
-		d();
-	}
+	int a = 0;
+
+	if (a)
+		b();
+	else
+		c();
+
+	if (a) {
+		b();
+		c();
+	} else {
+		d();
+	}
 }
 </pre>
 
@@ -158,12 +158,12 @@ my_function(void)
   sense;
 
 <pre>
-	long_variable_name =
-		function_with_a_really_long_name(parameter1, parameter2,
-						 parameter3, parameter4);
+	long_variable_name =
+		function_with_a_really_long_name(parameter1, parameter2,
+						 parameter3, parameter4);
 
-	x = function_with_a_really_long_name(parameter1, parameter2,
-					     parameter3, parameter4);
+	x = function_with_a_really_long_name(parameter1, parameter2,
+					     parameter3, parameter4);
 </pre>
 
 Conduct
-- 
2.16.4



More information about the wayland-devel mailing list