Code Climate renderer - update PMD Developer URL

This commit is contained in:
Andreas Dangel
2016-06-04 19:40:00 +02:00
parent 8a9bccb583
commit 0ec5f63744
2 changed files with 17 additions and 6 deletions

View File

@ -37,8 +37,11 @@ public class CodeClimateRenderer extends AbstractIncrementingRenderer {
private Rule rule;
private final String pmdDeveloperUrl;
public CodeClimateRenderer() {
super(NAME, "Code Climate integration.");
pmdDeveloperUrl = getPmdDeveloperURL();
}
/**
@ -135,7 +138,15 @@ public class CodeClimateRenderer extends AbstractIncrementingRenderer {
return result;
}
private static String getPmdDeveloperURL() {
String url = "http://pmd.github.io/pmd-" + PMD.VERSION + "/customizing/pmd-developer.html";
if (PMD.VERSION.contains("SNAPSHOT")) {
url = "http://pmd.sourceforge.net/snapshot/customizing/pmd-developer.html";
}
return url;
}
private <T> String getBody() {
String result = "## " + rule.getName() + "\\n\\n" +
"Since: PMD " + rule.getSince() + "\\n\\n" +
@ -155,7 +166,7 @@ public class CodeClimateRenderer extends AbstractIncrementingRenderer {
}
if(!rule.getPropertyDescriptors().isEmpty()) {
result += "\\n\\n### [PMD properties](http://pmd.github.io/pmd-5.1.3/pmd-developer.html)\\n\\n";
result += "\\n\\n### [PMD properties](" + pmdDeveloperUrl + ")\\n\\n";
result += "Name | Value | Description\\n";
result += "--- | --- | ---\\n";

View File

@ -19,7 +19,7 @@ public class CodeClimateRendererTest extends AbstractRendererTst {
+ "[Categories](https://github.com/codeclimate/spec/blob/master/SPEC.md#categories): Style\\n\\n"
+ "[Remediation Points](https://github.com/codeclimate/spec/blob/master/SPEC.md#remediation-points): 50000\\n\\n"
+ "desc\\n\\n"
+ "### [PMD properties](http://pmd.github.io/pmd-5.1.3/pmd-developer.html)\\n\\n"
+ "### [PMD properties](http://pmd.sourceforge.net/snapshot/customizing/pmd-developer.html)\\n\\n"
+ "Name | Value | Description\\n"
+ "--- | --- | ---\\n"
+ "violationSuppressRegex | | Suppress violations with messages matching a regular expression\\n"
@ -34,7 +34,7 @@ public class CodeClimateRendererTest extends AbstractRendererTst {
+ "[Categories](https://github.com/codeclimate/spec/blob/master/SPEC.md#categories): Style\\n\\n"
+ "[Remediation Points](https://github.com/codeclimate/spec/blob/master/SPEC.md#remediation-points): 50000\\n\\n"
+ "desc\\n\\n"
+ "### [PMD properties](http://pmd.github.io/pmd-5.1.3/pmd-developer.html)\\n\\n"
+ "### [PMD properties](http://pmd.sourceforge.net/snapshot/customizing/pmd-developer.html)\\n\\n"
+ "Name | Value | Description\\n"
+ "--- | --- | ---\\n"
+ "violationSuppressRegex | | Suppress violations with messages matching a regular expression\\n"
@ -56,7 +56,7 @@ public class CodeClimateRendererTest extends AbstractRendererTst {
+ "[Categories](https://github.com/codeclimate/spec/blob/master/SPEC.md#categories): Style\\n\\n"
+ "[Remediation Points](https://github.com/codeclimate/spec/blob/master/SPEC.md#remediation-points): 50000\\n\\n"
+ "desc\\n\\n"
+ "### [PMD properties](http://pmd.github.io/pmd-5.1.3/pmd-developer.html)\\n\\n"
+ "### [PMD properties](http://pmd.sourceforge.net/snapshot/customizing/pmd-developer.html)\\n\\n"
+ "Name | Value | Description\\n"
+ "--- | --- | ---\\n"
+ "violationSuppressRegex | | Suppress violations with messages matching a regular expression\\n"
@ -67,7 +67,7 @@ public class CodeClimateRendererTest extends AbstractRendererTst {
+ "[Categories](https://github.com/codeclimate/spec/blob/master/SPEC.md#categories): Style\\n\\n"
+ "[Remediation Points](https://github.com/codeclimate/spec/blob/master/SPEC.md#remediation-points): 50000\\n\\n"
+ "desc\\n\\n"
+ "### [PMD properties](http://pmd.github.io/pmd-5.1.3/pmd-developer.html)\\n\\n"
+ "### [PMD properties](http://pmd.sourceforge.net/snapshot/customizing/pmd-developer.html)\\n\\n"
+ "Name | Value | Description\\n"
+ "--- | --- | ---\\n"
+ "violationSuppressRegex | | Suppress violations with messages matching a regular expression\\n"