Pattern: Malformed alignment of assignment
Issue: -
This rule checks the alignment of assignment operators. If there are multiple adjacent assignments, it checks that the equals signs of each assignment are aligned.
The difference in alignment between two adjacent assignments is occasionally quite large, so aligning equals signs would create extremely long lines. By setting the maxPadding
property, you can configure the maximum amount of padding required to align the assignment with the surrounding assignments before the alignment is ignored and no warnings will be generated.
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="50" />
</properties>
</rule>
If the error
property is set to true
, an error will be thrown for violations instead of a warning.
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="error" value="true" />
</properties>
</rule>