[Ns-developers] script for coding style
Mathieu Lacage
mathieu.lacage at sophia.inria.fr
Fri Jan 8 22:34:26 PST 2010
On Sat, 2010-01-09 at 04:30 +0300, Andrey Mazo wrote:
> >It requires that you install 'uncrustify' (Note: there are a couple of
> >bugs in uncrustify which I am working on fixing for its next major
> >release but it works most of the time).
> I've tried revision 5368ca8086c0 with uncrustify 0.53 by "./check-style.py -l2 -f badformat.cc -i" and see the following faults (line numbers in badformat.cc after check-style.py execution):
I have 0.54 and 0.55 is the latest stable with git tip fixing 1) below.
> 1) ate spaces in comment (lines 27 and 42)
fixed in git tip of uncrustify.
> 2) "namespace ns3 {" -> "namespace ns3 \n {" while ns-3 uses first variant (line 132) (some time ago I had to replace "namespace ns3 {" with "QQQ ();" to fool a code beautifier)
I believe that this transformation is mandated by the current coding
style. I can make it otherwise I think.
> 3) left two statements on a line (line 213)
> 4) didn't add a space before parenthesis (lines 230 and 332)
> 5) didn't add a space before comma (lines 306 and 334)
Will look into these.
I am mostly interested in how it behaves on real code: if you do use it,
let me know what happens.
Mathieu
More information about the Ns-developers
mailing list