dotnet / codeformatter

Tool that uses Roslyn to automatically rewrite the source to follow our coding styles
MIT License
1.24k stars 244 forks source link

Question: Is it possible to create a rule that sorts my methods, fields, properties etc... #75

Open ghost opened 9 years ago

ghost commented 9 years ago

I have a big codebase which I want to sort by stylecop rules: http://stackoverflow.com/questions/150479/order-of-items-in-classes-fields-properties-constructors-methods

How would I start to programm such a feature? I would guess I add an additional rule... but what to do next...?

krwq commented 9 years ago

I would look at some Roslyn example projects. I.e: http://www.codeproject.com/Articles/302595/Roslyn-CTP-Three-Introductory-Projects

to get the idea of how it works like. After that I would either base your projects on one of the example projects and fill any gaps in knowledge with the documentation: https://roslyn.codeplex.com/documentation (they have samples in the documentation too)