.NET project file analyzers community

Proj2100: Indent RESX

As Wikipedia teaches us:

Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.([..])[https://en.wikipedia.org/wiki/XML]

To improve on the human-readable part, this rule ensures that the XML/RESX of the project files is properly indented. For now, only indentation using 2 spaces is supported, as we do not support reading the .editorconfig yet.

Non-compliant

<?xml version="1.0" encoding="utf-8"?>
<root>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
   <resheader name="reader">
    <value>System.Resources.ResXResourceReader</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter</value>
  </resheader>
   <data name="King" xml:space="preserve">
    <value>King</value>
		</data>
  <data name="Welcome" xml:space="preserve">
       <value>Hello, world!</value>
  </data>
</root>

Compliant

<?xml version="1.0" encoding="utf-8"?>
<root>

  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter</value>
  </resheader>

  <data name="King" xml:space="preserve">
    <value>King</value>
  </data>
  <data name="Welcome" xml:space="preserve">
    <value>Hello, world!</value>
  </data>
</root>