From c6184f84b7227e1548947e42bca3ff3ddb7e379c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 25 May 2015 10:18:35 -0600 Subject: [PATCH] docs: update the coding style information This hasn't been updated in a long time and from recent discussion on the mailing list, it's not always clear what's expected. Hopefully, this will help a bit. v2: document function brace placement, per Thomas Helland. Reviewed-by: Thomas Helland --- docs/devinfo.html | 165 ++++++++++++++++++++++++++-------------------- 1 file changed, 93 insertions(+), 72 deletions(-) diff --git a/docs/devinfo.html b/docs/devinfo.html index e068d87da13..f5113b0bd72 100644 --- a/docs/devinfo.html +++ b/docs/devinfo.html @@ -28,97 +28,118 @@

Coding Style

-Mesa's code style has changed over the years. Here's the latest. +Mesa is over 20 years old and the coding style has evolved over time. +Some old parts use a style that's a bit out of date. +If the guidelines below don't cover something, try following the format of +existing, neighboring code.

-Comment your code! It's extremely important that open-source code be -well documented. Also, strive to write clean, easily understandable code. +Basic formatting guidelines

-

-3-space indentation -

- -

-If you use tabs, set them to 8 columns -

- -

-Line width: the preferred width to fill comments and code in Mesa is 78 -columns. Exceptions are sometimes made for clarity (e.g. tabular data is -sometimes filled to a much larger width so that extraneous carriage returns -don't obscure the table). -

- -

-Brace example: -

+

Submitting patches