Make Apex XPath rules CodeClimate rules (doesn't fix failing test :-(

This commit is contained in:
Robert Sösemann
2017-03-02 14:23:22 +01:00
parent 6f92c2cbb9
commit e98c1eb96f
2 changed files with 10 additions and 9 deletions

View File

@ -9,8 +9,9 @@ import net.sourceforge.pmd.lang.ParserOptions;
import net.sourceforge.pmd.lang.apex.ApexLanguageModule; import net.sourceforge.pmd.lang.apex.ApexLanguageModule;
import net.sourceforge.pmd.lang.apex.ApexParserOptions; import net.sourceforge.pmd.lang.apex.ApexParserOptions;
import net.sourceforge.pmd.lang.rule.XPathRule; import net.sourceforge.pmd.lang.rule.XPathRule;
import net.sourceforge.pmd.renderers.CodeClimateRule;
public class ApexXPathRule extends XPathRule { public class ApexXPathRule extends XPathRule implements CodeClimateRule {
public ApexXPathRule() { public ApexXPathRule() {
super.setLanguage(LanguageRegistry.getLanguage(ApexLanguageModule.NAME)); super.setLanguage(LanguageRegistry.getLanguage(ApexLanguageModule.NAME));

View File

@ -12,8 +12,8 @@ The Braces ruleset contains rules regarding the use and placement of braces.
language="apex" language="apex"
since="5.6.0" since="5.6.0"
message="Avoid using if statements without curly braces" message="Avoid using if statements without curly braces"
class="net.sourceforge.pmd.lang.rule.XPathRule" class="net.sourceforge.pmd.lang.apex.rule.ApexXPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/java/braces.html#IfStmtsMustUseBraces"> externalInfoUrl="${pmd.website.baseurl}/rules/apex/braces.html#IfStmtsMustUseBraces">
<description> <description>
Avoid using if statements without using braces to surround the code block. If the code Avoid using if statements without using braces to surround the code block. If the code
formatting or indentation is lost then it becomes difficult to separate the code being formatting or indentation is lost then it becomes difficult to separate the code being
@ -47,8 +47,8 @@ if (foo) { // preferred approach
language="apex" language="apex"
since="5.6.0" since="5.6.0"
message="Avoid using 'while' statements without curly braces" message="Avoid using 'while' statements without curly braces"
class="net.sourceforge.pmd.lang.rule.XPathRule" class="net.sourceforge.pmd.lang.apex.rule.ApexXPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/java/braces.html#WhileLoopsMustUseBraces"> externalInfoUrl="${pmd.website.baseurl}/rules/apex/braces.html#WhileLoopsMustUseBraces">
<description> <description>
Avoid using 'while' statements without using braces to surround the code block. If the code Avoid using 'while' statements without using braces to surround the code block. If the code
formatting or indentation is lost then it becomes difficult to separate the code being formatting or indentation is lost then it becomes difficult to separate the code being
@ -80,8 +80,8 @@ while (true) { // preferred approach
language="apex" language="apex"
since="5.6.0" since="5.6.0"
message="Avoid using 'if...else' statements without curly braces" message="Avoid using 'if...else' statements without curly braces"
class="net.sourceforge.pmd.lang.rule.XPathRule" class="net.sourceforge.pmd.lang.apex.rule.ApexXPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/java/braces.html#IfElseStmtsMustUseBraces"> externalInfoUrl="${pmd.website.baseurl}/rules/apex/braces.html#IfElseStmtsMustUseBraces">
<description> <description>
Avoid using if..else statements without using surrounding braces. If the code formatting Avoid using if..else statements without using surrounding braces. If the code formatting
or indentation is lost then it becomes difficult to separate the code being controlled or indentation is lost then it becomes difficult to separate the code being controlled
@ -119,8 +119,8 @@ if (foo)
language="apex" language="apex"
since="5.6.0" since="5.6.0"
message="Avoid using 'for' statements without curly braces" message="Avoid using 'for' statements without curly braces"
class="net.sourceforge.pmd.lang.rule.XPathRule" class="net.sourceforge.pmd.lang.apex.rule.ApexXPathRule"
externalInfoUrl="${pmd.website.baseurl}/rules/java/braces.html#ForLoopsMustUseBraces"> externalInfoUrl="${pmd.website.baseurl}/rules/apex/braces.html#ForLoopsMustUseBraces">
<description> <description>
Avoid using 'for' statements without using curly braces. If the code formatting or Avoid using 'for' statements without using curly braces. If the code formatting or
indentation is lost then it becomes difficult to separate the code being controlled indentation is lost then it becomes difficult to separate the code being controlled