I hope that we can all agree that having a standard formatting style makes things more readable. Even if we don't all work in this style
, reformatting before commiting work will stop some misunderstanding and allow faster acclimation of all programmers.
To help with that I've looked over the documents and parts of the source code & have built an atyle formatting options file:
///////////////////////////////////// blender_astyle_options /////////////////////////////////////////////
-t -C -N -l
#indent with tabs (4 default)
#break definition brackets but attach block brackets
It can be used from the command line as:
$> astyle --options=blender_astyle_options test.cpp
This will reformat the file 'test.cpp' to match the required system. A second file could be setup by you to change the blender source to your own personal formatting style for working on.
Of course this idea was borrowed from a different thread http://www.blender.org/modules.php?op=modload&name=phpBB2&file=viewtopic&t=41
. And credit should go to them as well: cessen brought the topic up, xitnalta named asytle, & EWLloyd provided the link to astyle http://sourceforge.net/projects/astyle/
Now please take this in the frame of mind it's ment. I only want to see the sources come to a stable standard as fast as possible. If this formatting standard is not acceptable it can be disscussed. But I will continue to lobby for a system that provides this kind of result. This may be a bit presumptuous of me, but like I said I only want blenders source to stabilize as quickly as possible.
If there are no major complaints I would be willing to start a project to reformat the current code base & build it into the make system. I also believe the current documents should be ammended to show that a system like this is in place.
One last comment about this. Some people may react violently to the thought of having to read/write code that is not in their preferred coding style. All I can say is that this reaction should be tempered by the knowledge that there are no 'standards' in coding and every shop I've worked in had different requirements. At each place I've needed to 'relearn' my coding style. Open source projects are no different. The Linux kernel project, GNU, & Apache all have formatting requirements. There is no reason why we shouldn't as well.
Thank you for keeping an open mind,