Skip to content

Commit

Permalink
refact: renaming to Creedengo
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilles Grousset committed Dec 10, 2024
1 parent 4bd893f commit 2a53a91
Show file tree
Hide file tree
Showing 103 changed files with 81 additions and 154 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://green-code-initiative.org/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,13 +15,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package io.ecocode.ios.pbxproj;
package org.greencodeinitiative.creedengo.ios.pbxproj;

import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition;
import org.sonarsource.analyzer.commons.BuiltInQualityProfileJsonLoader;

import io.ecocode.ios.Const;
import org.greencodeinitiative.creedengo.ios.Const;

public class EcoCodePbxprojQualityProfile implements BuiltInQualityProfilesDefinition {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://green-code-initiative.org/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,8 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package io.ecocode.ios.pbxproj;
package org.greencodeinitiative.creedengo.ios.pbxproj;

import org.reflections.Reflections;
import org.sonar.api.SonarRuntime;
Expand All @@ -26,10 +25,10 @@
import java.util.ArrayList;
import java.util.Set;

import io.ecocode.ios.Const;
import org.greencodeinitiative.creedengo.ios.Const;

public class EcoCodePbxprojRulesDefinition implements RulesDefinition {
private static final String RESOURCE_BASE_PATH = "io/ecocode/rules/pbxproj";
private static final String RESOURCE_BASE_PATH = "org/green-code-initiative/rules/pbxproj";
private static final String NAME = "PBXProj Rules Repository";
private static final String LANGUAGE = PbxprojLanguage.KEY;
private final SonarRuntime sonarRuntime;
Expand All @@ -43,7 +42,7 @@ public void define(Context context) {
NewRepository repository = context.createRepository(Const.PBXPROJ_REPOSITORY_KEY, LANGUAGE).setName(NAME);
RuleMetadataLoader ruleMetadataLoader = new RuleMetadataLoader(RESOURCE_BASE_PATH, sonarRuntime);

Reflections reflections = new Reflections("io.ecocode.ios.pbxproj.checks");
Reflections reflections = new Reflections("org.greencodeinitiative.creedengo.ios.pbxproj.checks");
Set<Class<? extends PbxprojRuleCheck>> checkClasses = reflections.getSubTypesOf(PbxprojRuleCheck.class);

ruleMetadataLoader.addRulesByAnnotatedClass(repository, new ArrayList<>(checkClasses));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://green-code-initiative.org/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode.ios.pbxproj;
package org.greencodeinitiative.creedengo.ios.pbxproj;

import org.antlr.v4.runtime.tree.ParseTree;
import org.sonar.api.batch.sensor.SensorContext;
Expand All @@ -24,9 +24,9 @@

import java.util.List;

import io.ecocode.ios.antlr.AntlrContext;
import io.ecocode.ios.antlr.ParseTreeItemVisitor;
import io.ecocode.ios.checks.RuleLoader;
import org.greencodeinitiative.creedengo.ios.antlr.AntlrContext;
import org.greencodeinitiative.creedengo.ios.antlr.ParseTreeItemVisitor;
import org.greencodeinitiative.creedengo.ios.checks.RuleLoader;

public class EcoCodePbxprojVisitor implements ParseTreeItemVisitor {
private static final Logger LOGGER = Loggers.get(EcoCodePbxprojVisitor.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://green-code-initiative.org/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode.ios.pbxproj;
package org.greencodeinitiative.creedengo.ios.pbxproj;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
Expand All @@ -28,7 +28,7 @@ public class EcoCodePbxprojQualityProfileTest {
@Test
public void define() {
// GIVEN
EcoCodePbxprojQualityProfile profile = new EcoCodePbxprojQualityProfile();
CreedengoPbxprojQualityProfile profile = new CreedengoPbxprojQualityProfile();
BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context();

// WHEN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://green-code-initiative.org/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode.ios.pbxproj;
package org.greencodeinitiative.creedengo.ios.pbxproj;

import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.doReturn;
Expand All @@ -34,15 +34,15 @@

public class EcoCodePbxprojRulesDefinitionTest {

private EcoCodePbxprojRulesDefinition sut;
private CreedengoPbxprojRulesDefinition sut;
private RulesDefinition.Context context;
private RulesDefinition.Repository repository;

@Before
public void setUp() {
final SonarRuntime sonarRuntime = mock(SonarRuntime.class);
doReturn(Version.create(0, 0)).when(sonarRuntime).getApiVersion();
sut = new EcoCodePbxprojRulesDefinition(sonarRuntime);
sut = new CreedengoPbxprojRulesDefinition(sonarRuntime);
context = new RulesDefinition.Context();
sut.define(context);
repository = context.repository(sut.repositoryKey());
Expand All @@ -51,7 +51,7 @@ public void setUp() {
@Test
public void define() {
RulesDefinition.Context context = new RulesDefinition.Context();
EcoCodePbxprojRulesDefinition rulesDefinition = new EcoCodePbxprojRulesDefinition(mock(SonarRuntime.class));
CreedengoPbxprojRulesDefinition rulesDefinition = new CreedengoPbxprojRulesDefinition(mock(SonarRuntime.class));
rulesDefinition.define(context);
RulesDefinition.Repository repository = context.repository(rulesDefinition.repositoryKey());
assertNotNull(repository);
Expand All @@ -61,7 +61,7 @@ public void define() {
public void testMetadata() {
assertEquals("PBXProj Rules Repository", repository.name());
assertEquals("pbxproj", repository.language());
assertEquals("ecoCode-pbxproj", repository.key());
assertEquals("creedengo-pbxproj", repository.key());
}

@Test
Expand All @@ -71,7 +71,7 @@ public void testRegisteredRulesNumber() {

@Test
public void assertRuleProperties() {
Rule rule = repository.rule("EC547");
Rule rule = repository.rule("GCI547");
assertNotNull(rule);
assertEquals("Light Mode Forced", rule.name());
assertEquals(Type.CONSTANT_ISSUE, rule.debtRemediationFunction().type());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://green-code-initiative.org/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,8 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package io.ecocode.ios.pbxproj;
package org.greencodeinitiative.creedengo.ios.pbxproj;

import static org.junit.Assert.assertEquals;

Expand All @@ -33,12 +32,12 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import io.ecocode.ios.antlr.AntlrContext;
import io.ecocode.ios.checks.RuleLoader;
import org.greencodeinitiative.creedengo.ios.antlr.AntlrContext;
import org.greencodeinitiative.creedengo.ios.checks.RuleLoader;

public class EcoCodePbxprojVisitorTest {

private EcoCodePbxprojVisitor sut;
private CreedengoPbxprojVisitor sut;
private RuleLoader<PbxprojRuleCheck> mockRuleLoader;
private PbxprojRuleCheck mockRuleCheck1;
private PbxprojRuleCheck mockRuleCheck2;
Expand All @@ -55,7 +54,7 @@ public void setUp() {
when(mockRuleLoader.loadRules()).thenReturn(mockRules);

// Initialize the PbxprojVisitor with the mock RuleLoader
sut = new EcoCodePbxprojVisitor(mockRuleLoader);
sut = new CreedengoPbxprojVisitor(mockRuleLoader);
}

@After
Expand Down
70 changes: 0 additions & 70 deletions sonar-ios-plugin/pom.xml.versionsBackup

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://green-code-initiative.org/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,15 +15,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode.ios;
package org.greencodeinitiative.creedengo.ios;

import io.ecocode.ios.swift.EcoCodeSwiftProfile;
import io.ecocode.ios.swift.EcoCodeSwiftRulesDefinition;
import io.ecocode.ios.swift.SwiftSensor;
import io.ecocode.ios.pbxproj.PbxprojLanguage;
import io.ecocode.ios.pbxproj.EcoCodePbxprojQualityProfile;
import io.ecocode.ios.pbxproj.EcoCodePbxprojRulesDefinition;
import io.ecocode.ios.pbxproj.PbxprojSensor;
import org.greencodeinitiative.creedengo.ios.swift.EcoCodeSwiftProfile;
import org.greencodeinitiative.creedengo.ios.swift.EcoCodeSwiftRulesDefinition;
import org.greencodeinitiative.creedengo.ios.swift.SwiftSensor;
import org.greencodeinitiative.creedengo.ios.pbxproj.PbxprojLanguage;
import org.greencodeinitiative.creedengo.ios.pbxproj.CreedengoPbxprojQualityProfile;
import org.greencodeinitiative.creedengo.ios.pbxproj.CreedengoPbxprojRulesDefinition;
import org.greencodeinitiative.creedengo.ios.pbxproj.PbxprojSensor;
import org.sonar.api.Plugin;
import org.sonar.api.config.PropertyDefinition;
import org.sonar.api.resources.Qualifiers;
Expand All @@ -44,8 +44,8 @@ public void define(Context context) {
.onQualifiers(Qualifiers.PROJECT)
.build(),
PbxprojLanguage.class,
EcoCodePbxprojRulesDefinition.class,
EcoCodePbxprojQualityProfile.class,
CreedengoPbxprojRulesDefinition.class,
CreedengoPbxprojQualityProfile.class,
PbxprojSensor.class
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ecoCode iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://www.ecocode.io/)
* Creedengo iOS plugin - Help the earth, adopt this green plugin for your applications
* Copyright © 2023 green-code-initiative (https://green-code-initiative.org/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -15,9 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.ecocode.ios.swift;
package org.greencodeinitiative.creedengo.ios.swift;

import io.ecocode.ios.Const;
import org.greencodeinitiative.creedengo.ios.Const;
import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition;
import org.sonarsource.analyzer.commons.BuiltInQualityProfileJsonLoader;

Expand Down
Loading

0 comments on commit 2a53a91

Please sign in to comment.