Add rule definition in codestyle.xml

This commit is contained in:
Gwilym Kuiper
2020-04-01 11:28:14 +01:00
parent 8acb63870c
commit 1d62a1f984

View File

@ -365,4 +365,27 @@ while (true) { // preferred approach
</example>
</rule>
<rule name="FieldDeclarationsShouldBeAtStart"
language="apex"
since="5.23.0"
message="Field declarations should be before method declarations in a class"
class="net.sourceforge.pmd.lang.apex.rule.codestyle.FieldDeclarationsShouldBeAtStartRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_apex_codestyle.html#fielddeclarationsshouldbeatstart">
<description>
Field declarations should appear before method declarations within a class.
</description>
<priority>3</priority>
<example>
<![CDATA[
class Foo {
public Integer someField; // good
public void someMethod() {
}
public Integer anotherField; // bad
}
]]>
</example>
</rule>
</ruleset>