NuttX Code style
Meier Lorenz <lm@...
2014-03-04 08:48:17 GMT
As you all might have noticed I’m trying to lobby for a higher level of automation in the NuttX
contribution process, as it saves a lot of effort on the contributing and receiving (Greg’s) end.
Before you read on, I’m *NOT* suggesting to re-format the codebase to enforce the NuttX coding style.
This will turn anyone’s local branches into effective NuttX forks. I’m however advocating to settle
on a common code formatting tool (following / configured to the current code style) and to run files that
are contributed back through it. This will less intrusively but slowly get all of the NuttX files into a
consistent code standard.
The reason to do this is that this would allow contributors to use a script to get their contributions into
the right code style. This in turn would allow Greg to accept contributions unchanged via GIT, which will
reduce greatly the amount of friction currently introduced by manual editing of the patches (and would
allow to retain a consistent history, which allows to use GIT effectively by the downstream adopters like us).
Here is a complete shell script that pretty much matches the NuttX coding style:
You apparently need astyle installed. I have put this in misc/tools in my NuttX copy, made it executable via
chmod u+x and then can run it on any file, e.g.:
Once you run it on one of the existing files, you will notice that it will do a few changes (use ‚git diff‘
to see the changes). I consider the changes it does as valid, since the indentation changes look like the
file was inconsistent with the coding style before.
This all might look pedantic at a first glance, but at least our ability to effectively stay up to date to
mainline NuttX and to contribute back depends on being able to use all the great automation tools the 21st
century offers for software collaboration - most notably GIT. More rigor in the contributions will allow
Greg to leverage it effectively without giving up on a consistent coding style.
Yahoo Groups Links
<*> To visit your group on the web, go to:
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo Groups is subject to: