Skip to content

Commit 4656983

Browse files
committed
migration from ecocode to creedengo
1 parent fe88c79 commit 4656983

129 files changed

Lines changed: 369 additions & 368 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.

.github/workflows/_BACKUP_manual_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
id: export_jar_files
6161
uses: actions/upload-artifact@v3
6262
with:
63-
name: ecocode-plugins
63+
name: creedengo-plugins
6464
path: lib
6565
- name: Export LAST_TAG
6666
id: export_last_tag
@@ -77,7 +77,7 @@ jobs:
7777
id: import_jar_files
7878
uses: actions/download-artifact@v3
7979
with:
80-
name: ecocode-plugins
80+
name: creedengo-plugins
8181
path: lib
8282
- name: Upload Release Asset - Java Plugin
8383
id: upload-release-asset

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
env:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5353
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
54-
run: ./mvnw -e -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_ecoCode-java
54+
run: ./mvnw -e -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_creedengo-java

.github/workflows/build_container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
env:
1616
# github.repository as <account>/<repo>
17-
# IMAGE_NAME: sonarqube-ecocode
17+
# IMAGE_NAME: sonarqube-creedengo
1818
# IMAGES: |
1919
# ghcr.io/${{ github.repository_owner }}/sonarqube-ecocode
2020
IMAGE_NAME: sonarqube-ecocode-java

.github/workflows/tag_release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
id: export_jar_files
4646
uses: actions/upload-artifact@v3
4747
with:
48-
name: ecocode-plugins
48+
name: creedengo-plugins
4949
path: target
5050
- name: Export UPLOAD_URL
5151
id: export_upload_url
@@ -60,7 +60,7 @@ jobs:
6060
id: import_jar_files
6161
uses: actions/download-artifact@v3
6262
with:
63-
name: ecocode-plugins
63+
name: creedengo-plugins
6464
path: target
6565
- name: Upload Release Asset - Java Plugin
6666
id: upload-release-asset
@@ -69,6 +69,6 @@ jobs:
6969
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7070
with:
7171
upload_url: ${{needs.build.outputs.upload_url}}
72-
asset_path: target/ecocode-java-plugin-${{ github.ref_name }}.jar
72+
asset_path: target/creedengo-java-plugin-${{ github.ref_name }}.jar
7373
asset_name: ecocode-java-plugin-${{ github.ref_name }}.jar
7474
asset_content_type: application/zip

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ ARG SONARQUBE_VERSION=10.6.0-community
33

44
FROM maven:${MAVEN_BUILDER} AS builder
55

6-
COPY . /usr/src/ecocode
6+
COPY . /usr/src/creedengo
77

8-
WORKDIR /usr/src/ecocode
8+
WORKDIR /usr/src/creedengo
99
COPY src src/
1010
COPY pom.xml tool_build.sh ./
1111

1212
RUN ./tool_build.sh
1313

1414
FROM sonarqube:${SONARQUBE_VERSION}
15-
COPY --from=builder /usr/src/ecocode/target/ecocode-*.jar /opt/sonarqube/extensions/plugins/
15+
COPY --from=builder /usr/src/creedengo/target/creedengo-*.jar /opt/sonarqube/extensions/plugins/
1616
USER sonarqube

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ You can give a try with a one command:
3232
./mvnw verify -Pkeep-running
3333
```
3434

35-
... then you can use Java test project repository to test the environment : see [Java test project in `./src/it/test-projects/ecocode-java-plugin-test-project`](./src/it/test-projects/ecocode-java-plugin-test-project)
35+
... then you can use Java test project repository to test the environment : see [Java test project in `./src/it/test-projects/ecocode-java-plugin-test-project`](./src/it/test-projects/creedengo-java-plugin-test-project)
3636

3737
NB: To install other `ecocode` plugins, you can :
3838

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: sonarqube_ecocode_java
1+
name: sonarqube_creedengo_java
22

33
services:
44
sonar:
55
build: .
6-
container_name: sonar_ecocode_java
6+
container_name: sonar_creedengo_java
77
ports:
88
- ":9000"
99
networks:
@@ -28,7 +28,7 @@ services:
2828

2929
db:
3030
image: postgres:12
31-
container_name: postgresql_ecocode_java
31+
container_name: postgresql_creedengo_java
3232
networks:
3333
- sonarnet
3434
volumes:

pom.xml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44

5-
<groupId>io.ecocode</groupId>
6-
<artifactId>ecocode-java-plugin</artifactId>
7-
<version>1.7.0-SNAPSHOT</version>
5+
<groupId>org.green-code-initiative</groupId>
6+
<artifactId>creedengo-java-plugin</artifactId>
7+
<version>2.0.0-SNAPSHOT</version>
88

99
<packaging>sonar-plugin</packaging>
1010

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

15-
<url>https://github.com/green-code-initiative/ecoCode-java</url>
15+
<url>https://github.com/green-code-initiative/creedengo-java</url>
1616
<organization>
1717
<name>green-code-initiative</name>
1818
<url>https://github.com/green-code-initiative</url>
@@ -27,15 +27,15 @@
2727
</licenses>
2828

2929
<scm>
30-
<connection>scm:git:https://github.com/green-code-initiative/ecocode-java</connection>
31-
<developerConnection>scm:git:https://github.com/green-code-initiative/ecocode-java</developerConnection>
32-
<url>https://github.com/green-code-initiative/ecocode-java</url>
30+
<connection>scm:git:https://github.com/green-code-initiative/creedengo-java</connection>
31+
<developerConnection>scm:git:https://github.com/green-code-initiative/creedengo-java</developerConnection>
32+
<url>https://github.com/green-code-initiative/creedengo-java</url>
3333
<tag>HEAD</tag>
3434
</scm>
3535

3636
<issueManagement>
3737
<system>GitHub</system>
38-
<url>https://github.com/green-code-initiative/ecoCode-java/issues</url>
38+
<url>https://github.com/green-code-initiative/creedengo-java/issues</url>
3939
</issueManagement>
4040

4141
<properties>
@@ -55,10 +55,10 @@
5555

5656
<!-- Version of SonarQube for integration tests -->
5757
<sonarqube.version>9.9.7.96285</sonarqube.version>
58-
<!-- Version of the SonarQube APIs used by `ecocode-java-plugin` -->
58+
<!-- Version of the SonarQube APIs used by `creedengo-java-plugin` -->
5959
<sonar.plugin.api.version>9.8.0.203</sonar.plugin.api.version>
6060

61-
<!-- Version of `sonar-java-plugin` that `ecocode-java-plugin` depends on -->
61+
<!-- Version of `sonar-java-plugin` that `creedengo-java-plugin` depends on -->
6262
<sonarjava.version>7.16.0.30901</sonarjava.version>
6363

6464
<sonar-analyzer-commons.version>2.5.0.1358</sonar-analyzer-commons.version>
@@ -237,8 +237,8 @@
237237
<version>${sonar-packaging.version}</version>
238238
<extensions>true</extensions>
239239
<configuration>
240-
<pluginKey>ecocodejava</pluginKey>
241-
<pluginClass>org.greencodeinitiative.java.JavaPlugin</pluginClass>
240+
<pluginKey>creedengojava</pluginKey>
241+
<pluginClass>org.greencodeinitiative.creedengo.java.JavaPlugin</pluginClass>
242242
<sonarLintSupported>true</sonarLintSupported>
243243
<pluginApiMinVersion>${sonarqube.version}</pluginApiMinVersion>
244244
<skipDependenciesPackaging>true</skipDependenciesPackaging>
@@ -298,7 +298,7 @@
298298
</excludes>
299299
</filter>
300300
<filter>
301-
<artifact>io.ecocode:ecocode-rules-specifications:*</artifact>
301+
<artifact>org.green-code-initiative:creedengo-rules-specifications:*</artifact>
302302
<excludes>
303303
<exclude>META-INF/**</exclude>
304304
</excludes>
@@ -383,7 +383,7 @@
383383
<configuration>
384384
<properties>
385385
<owner>Green Code Initiative</owner>
386-
<email>https://www.ecocode.io</email>
386+
<email>https://green-code-initiative.org</email>
387387
</properties>
388388
<licenseSets>
389389
<licenseSet>
@@ -470,15 +470,15 @@
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/org/greencodeinitiative/java/ecoCode_way_profile.json,
473+
${project.baseUri}/src/main/resources/org/greencodeinitiative/creedengo/java/creedengo_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>
477-
io.ecocode:ecocode-java-plugin-test-project|ecoCode Java Sonar Plugin Test Project|${project.baseUri}/src/it/test-projects/ecocode-java-plugin-test-project/pom.xml,
477+
org.green-code-initiative:creedengo-java-plugin-test-project|creedengo Java Sonar Plugin Test Project|${project.baseUri}/src/it/test-projects/creedengo-java-plugin-test-project/pom.xml,
478478
</test-it.test-projects>
479479
<!-- Comma separated list of profiles to associate to each "test project". Syntaxe: `language:profileName` -->
480480
<test-it.test-project-profile-by-language>
481-
java|ecoCode way,
481+
java|creedengo way,
482482
</test-it.test-project-profile-by-language>
483483
</systemPropertyVariables>
484484
</configuration>
@@ -493,7 +493,8 @@
493493
<id>keep-running</id>
494494
<properties>
495495
<test-it.sonarqube.keepRunning>true</test-it.sonarqube.keepRunning>
496-
<test-it.sonarqube.port>9000</test-it.sonarqube.port>
496+
<!-- <test-it.sonarqube.port>9000</test-it.sonarqube.port>-->
497+
<test-it.sonarqube.port>33333</test-it.sonarqube.port>
497498
</properties>
498499
</profile>
499500
</profiles>

src/it/java/io/ecocode/java/integration/tests/LaunchSonarqubeAndBuildProjectIT.java renamed to src/it/java/org/greencodeinitiative/creedengo/java/integration/tests/LaunchSonarqubeAndBuildProjectIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.ecocode.java.integration.tests;
1+
package org.greencodeinitiative.creedengo.java.integration.tests;
22

33
import java.net.MalformedURLException;
44
import java.net.URI;
@@ -23,7 +23,7 @@
2323
import com.sonar.orchestrator.locator.Location;
2424
import com.sonar.orchestrator.locator.MavenLocation;
2525
import com.sonar.orchestrator.locator.URLLocation;
26-
import io.ecocode.java.integration.tests.profile.ProfileBackup;
26+
import org.greencodeinitiative.creedengo.java.integration.tests.profile.ProfileBackup;
2727
import org.junit.jupiter.api.AfterAll;
2828
import org.junit.jupiter.api.BeforeAll;
2929
import org.junit.jupiter.api.Test;
@@ -136,12 +136,12 @@ void test() {
136136
List<Issues.Issue> projectIssues = issuesForComponent(projectKey);
137137
assertThat(projectIssues).isNotEmpty();
138138

139-
List<Issues.Issue> issuesForArrayCopyCheck = issuesForFile(projectKey, "src/main/java/fr/greencodeinitiative/java/checks/AvoidGettingSizeCollectionInForLoopIgnored.java");
139+
List<Issues.Issue> issuesForArrayCopyCheck = issuesForFile(projectKey, "src/main/java/org/greencodeinitiative/creedengo/java/checks/AvoidGettingSizeCollectionInForLoopIgnored.java");
140140

141141
assertThat(issuesForArrayCopyCheck)
142142
.hasSize(1)
143143
.first().satisfies(issue -> {
144-
assertThat(issue.getRule()).isEqualTo("ecocode-java:GCI69");
144+
assertThat(issue.getRule()).isEqualTo("creedengo-java:GCI69");
145145
assertThat(issue.getSeverity()).isEqualTo(MINOR);
146146
assertThat(issue.getLine()).isEqualTo(18);
147147
assertThat(issue.getTextRange().getStartLine()).isEqualTo(18);

src/it/java/io/ecocode/java/integration/tests/profile/ProfileBackup.java renamed to src/it/java/org/greencodeinitiative/creedengo/java/integration/tests/profile/ProfileBackup.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.ecocode.java.integration.tests.profile;
1+
package org.greencodeinitiative.creedengo.java.integration.tests.profile;
22

33
import java.io.IOException;
44
import java.io.InputStream;
@@ -19,7 +19,7 @@
1919
* <p>Example, following JSON profile:</p>
2020
* <pre>
2121
* {
22-
* "name": "ecoCode way",
22+
* "name": "creedengo way",
2323
* "language": "java",
2424
* "ruleKeys": [
2525
* "GCI1",
@@ -31,18 +31,18 @@
3131
* <pre>
3232
* &lt;?xml version='1.0' encoding='UTF-8'?&gt;
3333
* &lt;profile&gt;
34-
* &lt;name&gt;ecoCode way&lt;/name&gt;
34+
* &lt;name&gt;creedengo way&lt;/name&gt;
3535
* &lt;language&gt;java&lt;/language&gt;
3636
* &lt;rules&gt;
3737
* &lt;rule&gt;
38-
* &lt;repositoryKey&gt;ecocode-java&lt;/repositoryKey&gt;
38+
* &lt;repositoryKey&gt;creedengo-java&lt;/repositoryKey&gt;
3939
* &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;
45-
* &lt;repositoryKey&gt;ecocode-java&lt;/repositoryKey&gt;
45+
* &lt;repositoryKey&gt;creedengo-java&lt;/repositoryKey&gt;
4646
* &lt;key&gt;GCI2&lt;/key&gt;
4747
* &lt;type&gt;CODE_SMELL&lt;/type&gt;
4848
* &lt;priority&gt;MINOR&lt;/priority&gt;
@@ -98,7 +98,7 @@ private ProfileMetadata profileMetadata() {
9898
}
9999

100100
private RuleMetadata loadRule(String language, String ruleKey) {
101-
try (InputStream ruleMetadataJsonFile = ClassLoader.getSystemResourceAsStream("io/ecocode/rules/" + language + "/" + ruleKey + ".json")) {
101+
try (InputStream ruleMetadataJsonFile = ClassLoader.getSystemResourceAsStream("org/green-code-initiative/rules/" + language + "/" + ruleKey + ".json")) {
102102
RuleMetadata result = mapper.readValue(ruleMetadataJsonFile, RuleMetadata.class);
103103
result.setKey(ruleKey);
104104
return result;
@@ -114,7 +114,7 @@ private String xmlProfile() throws IOException {
114114
.map(ruleKey -> this.loadRule(language, ruleKey))
115115
.collect(Collectors.toList());
116116
StringBuilder output = new StringBuilder();
117-
String repositoryKey = "ecocode-" + profileMetadata.getLanguage();
117+
String repositoryKey = "creedengo-" + profileMetadata.getLanguage();
118118
rules.forEach(rule -> output.append(
119119
xmlRule(
120120
repositoryKey,

0 commit comments

Comments
 (0)