Skip to content

Commit 7d67842

Browse files
committed
chore: rename rule keys ECXXX to the Green Code Initiative naming convention GCIXXX
1 parent f209741 commit 7d67842

22 files changed

Lines changed: 47 additions & 46 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- [#59](https://github.com/green-code-initiative/ecoCode-java/pull/59) Add builtin profile `ecoCode way` to aggregate all implemented ecoCode rules by this plugin
1313
- [#53](https://github.com/green-code-initiative/ecoCode-java/issues/53) Improve integration tests
14+
- Rename rules ECXXX to the new Green Code Initiative naming convention GCIXXX
1415

1516
### Changed
1617

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171

7272
<google.re2j>1.7</google.re2j>
7373

74-
<!-- Version of ecoCode rules specifications implemented by this plugin -->
75-
<ecocode-rules-specifications.version>1.6.5</ecocode-rules-specifications.version>
74+
<!-- Version of creedengo rules specifications implemented by this plugin -->
75+
<creedengo-rules-specifications.version>main-SNAPSHOT</creedengo-rules-specifications.version>
7676

7777
<!-- URL of the Maven repository where sonarqube will be downloaded -->
7878
<test-it.orchestrator.artifactory.url>https://repo1.maven.org/maven2</test-it.orchestrator.artifactory.url>
@@ -91,9 +91,9 @@
9191

9292
<dependencies>
9393
<dependency>
94-
<groupId>${project.groupId}</groupId>
95-
<artifactId>ecocode-rules-specifications</artifactId>
96-
<version>${ecocode-rules-specifications.version}</version>
94+
<groupId>org.green-code-initiative</groupId>
95+
<artifactId>creedengo-rules-specifications</artifactId>
96+
<version>${creedengo-rules-specifications.version}</version>
9797
<classifier>java</classifier>
9898
</dependency>
9999

src/it/java/io/ecocode/java/integration/tests/LaunchSonarqubeAndBuildProjectIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void test() {
141141
assertThat(issuesForArrayCopyCheck)
142142
.hasSize(1)
143143
.first().satisfies(issue -> {
144-
assertThat(issue.getRule()).isEqualTo("ecocode-java:EC69");
144+
assertThat(issue.getRule()).isEqualTo("ecocode-java:GCI69");
145145
assertThat(issue.getSeverity()).isEqualTo(MINOR);
146146
assertThat(issue.getLine()).isEqualTo(18);
147147
assertThat(issue.getTextRange().getStartLine()).isEqualTo(18);
@@ -445,4 +445,4 @@ private static WsClient newWsClient(Orchestrator orchestrator) {
445445
.url(orchestrator.getServer().getUrl())
446446
.build());
447447
}
448-
}
448+
}

src/it/java/io/ecocode/java/integration/tests/profile/ProfileBackup.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
* "name": "ecoCode way",
2323
* "language": "java",
2424
* "ruleKeys": [
25-
* "EC1",
26-
* "EC2"
25+
* "GCI1",
26+
* "GCI2"
2727
* ]
2828
* }
2929
* </pre>
@@ -36,14 +36,14 @@
3636
* &lt;rules&gt;
3737
* &lt;rule&gt;
3838
* &lt;repositoryKey&gt;ecocode-java&lt;/repositoryKey&gt;
39-
* &lt;key&gt;EC1&lt;/key&gt;
39+
* &lt;key&gt;GCI1&lt;/key&gt;
4040
* &lt;type&gt;CODE_SMELL&lt;/type&gt;
4141
* &lt;priority&gt;MINOR&lt;/priority&gt;
4242
* &lt;parameters /&gt;
4343
* &lt;/rule&gt;
4444
* &lt;rule&gt;
4545
* &lt;repositoryKey&gt;ecocode-java&lt;/repositoryKey&gt;
46-
* &lt;key&gt;EC2&lt;/key&gt;
46+
* &lt;key&gt;GCI2&lt;/key&gt;
4747
* &lt;type&gt;CODE_SMELL&lt;/type&gt;
4848
* &lt;priority&gt;MINOR&lt;/priority&gt;
4949
* &lt;parameters /&gt;
@@ -160,4 +160,4 @@ public String language() {
160160
public String name() {
161161
return profileMetadata().getName();
162162
}
163-
}
163+
}

src/main/java/fr/greencodeinitiative/java/JavaRulesDefinition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* That allows to list the rules in the page "Rules".
2929
*/
3030
public class JavaRulesDefinition implements RulesDefinition {
31-
private static final String RESOURCE_BASE_PATH = "io/ecocode/rules/java";
31+
private static final String RESOURCE_BASE_PATH = "org/green-code-initiative/rules/java";
3232

3333
private static final String NAME = "ecoCode";
3434
static final String LANGUAGE = "java";

src/main/java/fr/greencodeinitiative/java/checks/ArrayCopyCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* @author Aubay
5454
* @formatter:off
5555
*/
56-
@Rule(key = "EC27")
56+
@Rule(key = "GCI27")
5757
@DeprecatedRuleKey(repositoryKey = "greencodeinitiative-java", ruleKey = "GRPS0027")
5858
public class ArrayCopyCheck extends IssuableSubscriptionVisitor {
5959

src/main/java/fr/greencodeinitiative/java/checks/AvoidFullSQLRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import org.sonar.plugins.java.api.tree.Tree.Kind;
3232
import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey;
3333

34-
@Rule(key = "EC74")
34+
@Rule(key = "GCI74")
3535
@DeprecatedRuleKey(repositoryKey = "greencodeinitiative-java", ruleKey = "S74")
3636
public class AvoidFullSQLRequest extends IssuableSubscriptionVisitor {
3737

src/main/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInLoop.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.sonar.plugins.java.api.tree.WhileStatementTree;
3535
import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey;
3636

37-
@Rule(key = "EC3")
37+
@Rule(key = "GCI3")
3838
@DeprecatedRuleKey(repositoryKey = "greencodeinitiative-java", ruleKey = "GSCIL")
3939
public class AvoidGettingSizeCollectionInLoop extends IssuableSubscriptionVisitor {
4040
protected static final String MESSAGERULE = "Avoid getting the size of the collection in the loop";

src/main/java/fr/greencodeinitiative/java/checks/AvoidMultipleIfElseStatement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* - an "ELSE" statement is considered as a second IF statement using the same variables used on previous
4444
* - IF and ELSEIF statements are considered as an IF statement
4545
*/
46-
@Rule(key = "EC2")
46+
@Rule(key = "GCI2")
4747
@DeprecatedRuleKey(repositoryKey = "greencodeinitiative-java", ruleKey = "AMIES")
4848
public class AvoidMultipleIfElseStatement extends IssuableSubscriptionVisitor {
4949

src/main/java/fr/greencodeinitiative/java/checks/AvoidRegexPatternNotStatic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.sonar.plugins.java.api.tree.Tree;
3333
import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey;
3434

35-
@Rule(key = "EC77")
35+
@Rule(key = "GCI77")
3636
@DeprecatedRuleKey(repositoryKey = "greencodeinitiative-java", ruleKey = "S77")
3737
public class AvoidRegexPatternNotStatic extends IssuableSubscriptionVisitor {
3838

0 commit comments

Comments
 (0)