From: Jean-Baptiste Lievremont Date: Mon, 17 Feb 2014 13:36:29 +0000 (+0100) Subject: Remove repository key from rendering of rule macro X-Git-Tag: 4.2~106 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=db57555d0d0ba1a58e4c9d9dc66632242166cde5;p=sonarqube.git Remove repository key from rendering of rule macro --- diff --git a/sonar-server/src/main/java/org/sonar/server/text/RuleMacro.java b/sonar-server/src/main/java/org/sonar/server/text/RuleMacro.java index e0209ef5699..795a305defa 100644 --- a/sonar-server/src/main/java/org/sonar/server/text/RuleMacro.java +++ b/sonar-server/src/main/java/org/sonar/server/text/RuleMacro.java @@ -36,6 +36,6 @@ class RuleMacro implements Macro { } public String getReplacement() { - return "$1:$2"; + return "$2"; } } diff --git a/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java b/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java index b23f84c0741..86c82fb0b43 100644 --- a/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java +++ b/sonar-server/src/test/java/org/sonar/server/text/MacroInterpreterTest.java @@ -53,7 +53,7 @@ public class MacroInterpreterTest { String ruleKey = "repo:key"; String origin = "See {rule:" + ruleKey + "} for detail."; String result = interpreter.interpret(origin); - assertThat(result).isEqualTo("See " + ruleKey + " for detail."); + assertThat(result).isEqualTo("See key for detail."); } @Test @@ -61,6 +61,6 @@ public class MacroInterpreterTest { String ruleKey = "my-repo1:my-key1"; String origin = "See {rule:" + ruleKey + "} for detail."; String result = interpreter.interpret(origin); - assertThat(result).isEqualTo("See " + ruleKey + " for detail."); + assertThat(result).isEqualTo("See my-key1 for detail."); } }