Is there an automatic code formatter for C#? [clos

2019-01-30 22:49发布

In my work I deal mostly with C# code nowadays, with a sprinkle of java from time to time. What I absolutely love about Eclipse (and I know people using it daily love it even more) is a sophisticated code formatter, able to mould code into any coding standard one might imagine. Is there such a tool for C#? Visual Studio code formatting (Crtl+K, Crtl+D) is subpar and StyleCop only checks the source without fixing it.

My dream tool would run from console (for easy inclusion in automated builds or pre-commit hooks and for execution on Linux + Mono), have text-file based configuration easy to store in a project repository and a graphical rule editor with preview - just like the Eclipse Code Formatter does.

14条回答
冷血范
2楼-- · 2019-01-30 23:20

I haven't tried this (found it through Google). Might work? http://www.semdesigns.com/Products/Formatters/CSharpFormatter.html. It's fairly cheap at USD50, but no trial available.

查看更多
可以哭但决不认输i
3楼-- · 2019-01-30 23:20

See this previous question:

Is there any tool for reformatting C# code?

Searching for [c#] astyle shows up some more previous questions too.

查看更多
登录 后发表回答