Skip to content

Commit fe88c79

Browse files
authored
Merge pull request #75 from vincent314/feature/rename-rules
chore: rename rule keys ECXXX to the Green Code Initiative naming convention GCIXXX
2 parents f209741 + d619ac7 commit fe88c79

121 files changed

Lines changed: 350 additions & 334 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<name>ecoCode - Java language</name>
1212
<description>Provides rules to reduce the environmental footprint of your Java programs</description>
13-
<inceptionYear>2023</inceptionYear>
13+
<inceptionYear>2024</inceptionYear>
1414

1515
<url>https://github.com/green-code-initiative/ecoCode-java</url>
1616
<organization>
@@ -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>2.0.0</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

@@ -238,7 +238,7 @@
238238
<extensions>true</extensions>
239239
<configuration>
240240
<pluginKey>ecocodejava</pluginKey>
241-
<pluginClass>fr.greencodeinitiative.java.JavaPlugin</pluginClass>
241+
<pluginClass>org.greencodeinitiative.java.JavaPlugin</pluginClass>
242242
<sonarLintSupported>true</sonarLintSupported>
243243
<pluginApiMinVersion>${sonarqube.version}</pluginApiMinVersion>
244244
<skipDependenciesPackaging>true</skipDependenciesPackaging>
@@ -470,7 +470,7 @@
470470
</test-it.plugins>
471471
<!-- Comma separated JSON profile file URIs to load -->
472472
<test-it.additional-profile-uris>
473-
${project.baseUri}/src/main/resources/fr/greencodeinitiative/java/ecoCode_way_profile.json,
473+
${project.baseUri}/src/main/resources/org/greencodeinitiative/java/ecoCode_way_profile.json,
474474
</test-it.additional-profile-uris>
475475
<!-- Comma separated paths of "test projects" to analyze. Syntaxe: `sonar.projectKey|sonar.projectName|project.pomUri` -->
476476
<test-it.test-projects>

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/it/test-projects/ecocode-java-plugin-test-project/src/main/java/fr/greencodeinitiative/java/checks/ArrayCopyCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fr.greencodeinitiative.java.checks;
1+
package org.greencodeinitiative.java.checks;
22

33
import java.util.Arrays;
44

@@ -490,4 +490,4 @@ private boolean transform(boolean a) {
490490
return !a;
491491
}
492492

493-
}
493+
}

src/it/test-projects/ecocode-java-plugin-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidFullSQLRequestCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fr.greencodeinitiative.java.checks;
1+
package org.greencodeinitiative.java.checks;
22

33
class AvoidFullSQLRequestCheck {
44
AvoidFullSQLRequestCheck(AvoidFullSQLRequestCheck mc) {
@@ -27,4 +27,4 @@ private void dummyCall(String request) {
2727

2828
}
2929

30-
}
30+
}

src/it/test-projects/ecocode-java-plugin-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInForEachLoopIgnored.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fr.greencodeinitiative.java.checks;
1+
package org.greencodeinitiative.java.checks;
22

33
import java.util.ArrayList;
44
import java.util.List;
@@ -18,4 +18,4 @@ public void ignoredLoop() {
1818
System.out.println("numberList.size()");
1919
}
2020
}
21-
}
21+
}

src/it/test-projects/ecocode-java-plugin-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInForLoopBad.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fr.greencodeinitiative.java.checks;
1+
package org.greencodeinitiative.java.checks;
22

33
import java.util.ArrayList;
44
import java.util.List;
@@ -17,4 +17,4 @@ public void badForLoop() {
1717
System.out.println("numberList.size()");
1818
}
1919
}
20-
}
20+
}

src/it/test-projects/ecocode-java-plugin-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInForLoopGood.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fr.greencodeinitiative.java.checks;
1+
package org.greencodeinitiative.java.checks;
22

33
import java.util.Collection;
44
import java.util.ArrayList;
@@ -20,4 +20,4 @@ public void goodForLoop() {
2020
int size2 = numberList.size(); // Compliant with this rule
2121
}
2222
}
23-
}
23+
}

src/it/test-projects/ecocode-java-plugin-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInForLoopIgnored.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fr.greencodeinitiative.java.checks;
1+
package org.greencodeinitiative.java.checks;
22

33
import java.util.ArrayList;
44
import java.util.Iterator;
@@ -20,4 +20,4 @@ public void badForLoop() {
2020
System.out.println("numberList.size()");
2121
}
2222
}
23-
}
23+
}

0 commit comments

Comments
 (0)