[ros-kernel] Coding style/indentation (again!?)

Andrew "Silver Blade" Greenwood lists at silverblade.co.uk
Sat Jan 31 08:42:11 CET 2004


I don't really care about there being a strict coding style... If there's
something I don't understand due to the way it's laid out, I'll change it so
that the structure makes sense to me...

----- Original Message ----- 
From: "Gunnar André Dalsnes" <hardon at online.no>
To: <ros-kernel at reactos.com>
Sent: Saturday, January 31, 2004 5:03 AM
Subject: [ros-kernel] Coding style/indentation (again!?)


> Hi,
>
> ROS' lack of coding style is still bugging me, so here we go again:
>
> First we have to agree on a coding style.
>
> Here's my suggestion: indent <file> -gnu -nut -bli0 -cbi0 -cli3 -bfda -i3
> -l100 -npcs -cdw
>
> Have a look at the attached example code to see if there's something you
> don't like, and try to find an indent option that fix the issue.
>
> Note that indent can't fix everything. For example, it doesn't seem to
have
> an option to break the line after all arguments in a function call (we
could
> implement this in indent thou).
>
> indent manual: http://2robots.com/man/index.php?indent
> indent for win32 (included in unxutil package):
> http://unxutils.sourceforge.net/
>
> Short desc:
> -gnu gnu presets (basis)
> -nut  no tabs (use space)
> -bliX indent braces X spaces
> -cbiX indent braces X spaces after case labels
> -cliX indent X spaces after case labels
> -bfda break the line before all arguments in a declaration
> -iX indent X spaces
> -lX break line at col X
> -npcs do not put space after the function in function calls
> -cdw cuddle while of do {} while; and preceeding `}'
>
>
> OPTIONS ON HOW TO INDENT:
>
> 1) Everyone run indent locally before commiting. We should have something
> like "make indent" or maybe indent as a part of the regular "make" process
> (the latter will bring unaceptable? overhead to the make process thou). If
> people don't want to run "make indent" they may create faster, home-made
> solutions: I've created a shotcut to a indent.bat in the
right-click->"Send
> To" context-menu.
> Pros: Simple
> Cons: Impossible to verify that people actually obey the rulez
>
> 2) Everyone does as in 1) BUT the cvs-server revokes the commit it it
> doesn't follow the rulez.
> Pros: Simple and secure. I have tested this and it works great.
> Cons: Jason didn't like this...
>
> 3) The cvs-server run indent on affected files after each commit
> I have tested this solution:
> http://www.loria.fr/~molli/fom-serve/cache/347.html
> Pros: Sounds good...
> Cons: If you commit changes to a file, the indented changes will not be
> reflected locally. You'll have to delete the file and update to get the
> indented changes. So if you make several commits without deleting and
> updating the file after each commit you will sometimes get errors when
> commiting (i got errors when i tested it). Diff will produce strange
results
> in this case also. Most of the time it works fine without deleting and
> updating, but not allways...
>
> 4) ???
>
> -Gunnar
>
>
> _______________________________________________
> Ros-kernel mailing list
> Ros-kernel at reactos.com
> http://reactos.com/mailman/listinfo/ros-kernel
>
>



More information about the Ros-kernel mailing list