[Mono-dev] C# automatic code formatter

M. David Peterson xmlhacker at gmail.com
Mon Aug 18 06:47:22 EDT 2008


On Mon, Aug 18, 2008 at 4:28 AM, Leszek Ciesielski <skolima at gmail.com>wrote:

> Hi,
>
> almost every week there is a patch submitted to this list that gets
> rejected/postponed because of formatting issues. Java has many very
> good tools like this, e.g. Eclipse built-in.


.NET has VS.NET, Sharp Develop, and MonoDevelop from a tooling perspective.


> Isn't there a tool for automatic formatting of C# code according to
> some guidelines (in this case,
> http://www.mono-project.com/Coding_Guidelines )?


NAnt has a task for converting tabs into spaces and vice versa.  It seems to
me that if an enhancement to this task doesn't already exist that formats
the source code based on a defined set of guidelines it shouldn't be too
difficult to create.  It might even be as easy as scripting up a MonoDevelop
macro of some sort.

To make things all that much better, writing an SVN hook that auto formats
each check-in might be an interesting approach.  It would certainly produce
cleaner diffs for review if each file was formatted using a pre-commit hook.

-- 
/M:D

M. David Peterson
Co-Founder & Chief Architect, 3rd&Urban, LLC
Email: m.david at 3rdandUrban.com | m.david at amp.fm
Mobile: (206) 999-0588
http://3rdandUrban.com | http://amp.fm |
http://www.oreillynet.com/pub/au/2354 |
http://news.oreilly.com/m-david-peterson/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080818/fa8ac1bf/attachment.html 


More information about the Mono-devel-list mailing list