In my C# development team, we want to share auto-formatting rules to respect our coding standards to have unified code formatting. I'm actually testing ReSharper and it's great but we have one rule in our standards that I can't seem to get around.
We use the HTMLTextWriter
to render some HTML but we have a rule to indent the calls to reflect how they markup will be outputted.
For example :
protected override void RenderBody(HtmlTextWriter writer)
{
writer.AddAttribute("class", "mystyle");
writer.RenderBeginTag("div");
writer.AddAttribute("class", "mystyle2");
writer.RenderBeginTag("div");
writer.Write("HELLO WORLD");
writer.RenderEndTag();
writer.RenderEndTag();
}
For now, when I reformat the code using ReSharper (or VS), the identation is removed.
Is there a way to add custom rule to prevent/disable reformatting around .RenderBeginTag
function calls? Or is there another tool (other than ReSharper or in addition to ReSharper) that could do that?