From 9ed44283cf0c97d5250dbffa7c20c81862744dc7 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Tue, 3 Dec 2024 22:27:28 +0100 Subject: [PATCH 01/15] next step for migration with last decisions --- pom.xml | 10 +++++----- .../creedengo}/python/PythonPlugin.java | 4 ++-- .../python/PythonRuleRepository.java | 10 +++++----- .../python/checks/AvoidFullSQLRequest.java | 5 +++-- .../python/checks/AvoidGettersAndSetters.java | 18 +++++++++--------- .../AvoidGlobalVariableInFunctionCheck.java | 5 +++-- .../AvoidListComprehensionInIterations.java | 6 ++++-- .../AvoidMultipleIfElseStatementCheck.java | 7 +++++-- .../python/checks/AvoidSQLRequestInLoop.java | 5 +++-- .../AvoidTryCatchWithFileOpenedCheck.java | 6 +++--- .../python/checks/AvoidUnlimitedCache.java | 8 +++++--- .../AvoidUnoptimizedVectorImagesCheck.java | 6 ++++-- .../checks/DetectUnoptimizedImageFormat.java | 16 ++++++++-------- .../creedengo}/python/package-info.java | 4 ++-- .../creedengo}/python/PythonPluginTest.java | 4 ++-- .../python/PythonRuleRepositoryTest.java | 8 ++++---- .../python/checks/AvoidFullSQLRequestTest.java | 4 ++-- .../checks/AvoidGettersAndSettersTest.java | 4 ++-- ...AvoidGlobalVariableInFunctionCheckTest.java | 5 ++--- ...AvoidListComprehensionInIterationsTest.java | 4 ++-- .../AvoidMultipleIfElseStatementCheckTest.java | 4 ++-- .../checks/AvoidSQLRequestInLoopTest.java | 4 ++-- .../AvoidTryCatchWithFileOpenedCheckTest.java | 4 ++-- .../python/checks/AvoidUnlimitedCacheTest.java | 4 ++-- .../AvoidUnoptimizedVectorImagesTest.java | 4 ++-- .../DetectUnoptimizedImageFormatTest.java | 4 ++-- 26 files changed, 87 insertions(+), 76 deletions(-) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/PythonPlugin.java (89%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/PythonRuleRepository.java (90%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidFullSQLRequest.java (94%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidGettersAndSetters.java (84%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidGlobalVariableInFunctionCheck.java (98%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidListComprehensionInIterations.java (93%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidMultipleIfElseStatementCheck.java (98%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidSQLRequestInLoop.java (95%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidTryCatchWithFileOpenedCheck.java (93%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidUnlimitedCache.java (91%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidUnoptimizedVectorImagesCheck.java (92%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/DetectUnoptimizedImageFormat.java (71%) rename src/main/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/package-info.java (88%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/PythonPluginTest.java (92%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/PythonRuleRepositoryTest.java (93%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidFullSQLRequestTest.java (89%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidGettersAndSettersTest.java (90%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidGlobalVariableInFunctionCheckTest.java (82%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidListComprehensionInIterationsTest.java (90%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidMultipleIfElseStatementCheckTest.java (91%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidSQLRequestInLoopTest.java (90%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidTryCatchWithFileOpenedCheckTest.java (90%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidUnlimitedCacheTest.java (90%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/AvoidUnoptimizedVectorImagesTest.java (90%) rename src/test/java/{fr/greencodeinitiative => org/greencodeinitiative/creedengo}/python/checks/DetectUnoptimizedImageFormatTest.java (91%) diff --git a/pom.xml b/pom.xml index b5c8138..3130373 100644 --- a/pom.xml +++ b/pom.xml @@ -2,14 +2,14 @@ 4.0.0 - io.greencodeinitiative + org.green-code-initiative creedengo-python-plugin - 2.0.0-SNAPSHOT + 1.0.0-SNAPSHOT sonar-plugin creedengo - Python language Provides rules to reduce the environmental footprint of your Python programs - 2023 + 2024 https://github.com/green-code-initiative/creedengo-python @@ -61,7 +61,7 @@ 5.14.1 - 1.6.4 + 1.6.5 @@ -173,7 +173,7 @@ true creedengopython - fr.greencodeinitiative.python.PythonPlugin + org.greencodeinitiative.creedengo.python.PythonPlugin true ${sonarqube.version} true diff --git a/src/main/java/fr/greencodeinitiative/python/PythonPlugin.java b/src/main/java/org/greencodeinitiative/creedengo/python/PythonPlugin.java similarity index 89% rename from src/main/java/fr/greencodeinitiative/python/PythonPlugin.java rename to src/main/java/org/greencodeinitiative/creedengo/python/PythonPlugin.java index f4285f1..345bc81 100644 --- a/src/main/java/fr/greencodeinitiative/python/PythonPlugin.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/PythonPlugin.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python; +package org.greencodeinitiative.creedengo.python; import org.sonar.api.Plugin; diff --git a/src/main/java/fr/greencodeinitiative/python/PythonRuleRepository.java b/src/main/java/org/greencodeinitiative/creedengo/python/PythonRuleRepository.java similarity index 90% rename from src/main/java/fr/greencodeinitiative/python/PythonRuleRepository.java rename to src/main/java/org/greencodeinitiative/creedengo/python/PythonRuleRepository.java index 206480d..e7cbff1 100644 --- a/src/main/java/fr/greencodeinitiative/python/PythonRuleRepository.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/PythonRuleRepository.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,9 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python; +package org.greencodeinitiative.creedengo.python; -import fr.greencodeinitiative.python.checks.*; +import org.greencodeinitiative.creedengo.python.checks.*; import org.sonar.api.SonarRuntime; import org.sonar.api.server.rule.RulesDefinition; import org.sonar.plugins.python.api.PythonCustomRuleRepository; @@ -44,9 +44,9 @@ public class PythonRuleRepository implements RulesDefinition, PythonCustomRuleRe ); public static final String LANGUAGE = "py"; - public static final String NAME = "ecoCode"; + public static final String NAME = "creedengo"; public static final String RESOURCE_BASE_PATH = "io/ecocode/rules/python"; - public static final String REPOSITORY_KEY = "ecocode-python"; + public static final String REPOSITORY_KEY = "creedengo-python"; private final SonarRuntime sonarRuntime; diff --git a/src/main/java/fr/greencodeinitiative/python/checks/AvoidFullSQLRequest.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidFullSQLRequest.java similarity index 94% rename from src/main/java/fr/greencodeinitiative/python/checks/AvoidFullSQLRequest.java rename to src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidFullSQLRequest.java index 34f5794..40086f0 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/AvoidFullSQLRequest.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidFullSQLRequest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.sonar.check.Rule; @@ -33,6 +33,7 @@ import java.util.regex.Pattern; @Rule(key = "EC74") +@DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC74") @DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "S74") public class AvoidFullSQLRequest extends PythonSubscriptionCheck { diff --git a/src/main/java/fr/greencodeinitiative/python/checks/AvoidGettersAndSetters.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGettersAndSetters.java similarity index 84% rename from src/main/java/fr/greencodeinitiative/python/checks/AvoidGettersAndSetters.java rename to src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGettersAndSetters.java index 1f4302c..8247260 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/AvoidGettersAndSetters.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGettersAndSetters.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import java.util.List; import java.util.stream.Collectors; @@ -28,13 +28,13 @@ import org.sonar.plugins.python.api.tree.FunctionDef; import org.sonar.plugins.python.api.tree.ParameterList; import org.sonar.plugins.python.api.tree.QualifiedExpression; -import org.sonar.plugins.python.api.tree.ReturnStatement; import org.sonar.plugins.python.api.tree.Statement; import org.sonar.plugins.python.api.tree.StatementList; import org.sonar.plugins.python.api.tree.Tree; import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; @Rule(key = "EC7") +@DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC7") @DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "D7") public class AvoidGettersAndSetters extends PythonSubscriptionCheck { @@ -62,23 +62,23 @@ private boolean isConstructorMethod(FunctionDef functionDef) { return functionDef.name() != null && "__init__".equals(functionDef.name().name()); } - public void checkAllSetters(List statements, FunctionDef functionDef, SubscriptionContext ctx) { + private void checkAllSetters(List statements, FunctionDef functionDef, SubscriptionContext ctx) { if (statements.size() == 1 && statements.get(0).is(Tree.Kind.ASSIGNMENT_STMT)) { AssignmentStatement assignmentStatement = (AssignmentStatement) statements.get(0); if (checkIfStatementIsQualifiedExpressionAndStartsWithSelfDot((QualifiedExpression) assignmentStatement.children().get(0).children().get(0))) { // Check if assignedValue is a parameter of the function ParameterList parameters = functionDef.parameters(); - if (parameters != null && !parameters.all().stream().filter(p -> checkAssignementFromParameter(assignmentStatement, p)).collect(Collectors.toList()).isEmpty()) { + if (parameters != null && !parameters.all().stream().filter(p -> checkAssignmentFromParameter(assignmentStatement, p)).collect(Collectors.toList()).isEmpty()) { ctx.addIssue(functionDef.defKeyword(), AvoidGettersAndSetters.DESCRIPTION); } } } } - public void checkAllGetters(List statements, FunctionDef functionDef, SubscriptionContext ctx) { + private void checkAllGetters(List statements, FunctionDef functionDef, SubscriptionContext ctx) { Statement lastStatement = statements.get(statements.size() - 1); if (lastStatement.is(Tree.Kind.RETURN_STMT)) { - List returnStatementChildren = ((ReturnStatement) lastStatement).children(); + List returnStatementChildren = lastStatement.children(); if (returnStatementChildren.get(1).is(Tree.Kind.QUALIFIED_EXPR) && checkIfStatementIsQualifiedExpressionAndStartsWithSelfDot((QualifiedExpression) returnStatementChildren.get(1))) { ctx.addIssue(functionDef.defKeyword(), AvoidGettersAndSetters.DESCRIPTION); @@ -86,12 +86,12 @@ public void checkAllGetters(List statements, FunctionDef functionDef, } } - public boolean checkAssignementFromParameter(AssignmentStatement assignmentStatement, AnyParameter parameter) { + private boolean checkAssignmentFromParameter(AssignmentStatement assignmentStatement, AnyParameter parameter) { String parameterToString = parameter.firstToken().value(); return assignmentStatement.assignedValue().firstToken().value().equalsIgnoreCase(parameterToString); } - public boolean checkIfStatementIsQualifiedExpressionAndStartsWithSelfDot(QualifiedExpression qualifiedExpression) { + private boolean checkIfStatementIsQualifiedExpressionAndStartsWithSelfDot(QualifiedExpression qualifiedExpression) { List qualifedExpressionChildren = qualifiedExpression.children(); return qualifedExpressionChildren.size() == 3 && qualifedExpressionChildren.get(0).firstToken().value().equalsIgnoreCase("self") && diff --git a/src/main/java/fr/greencodeinitiative/python/checks/AvoidGlobalVariableInFunctionCheck.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGlobalVariableInFunctionCheck.java similarity index 98% rename from src/main/java/fr/greencodeinitiative/python/checks/AvoidGlobalVariableInFunctionCheck.java rename to src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGlobalVariableInFunctionCheck.java index c9b127b..96a37e3 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/AvoidGlobalVariableInFunctionCheck.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGlobalVariableInFunctionCheck.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import java.util.ArrayList; import java.util.HashMap; @@ -79,6 +79,7 @@ import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; @Rule(key = "EC4") +@DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC4") @DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "D4") public class AvoidGlobalVariableInFunctionCheck extends PythonSubscriptionCheck { diff --git a/src/main/java/fr/greencodeinitiative/python/checks/AvoidListComprehensionInIterations.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidListComprehensionInIterations.java similarity index 93% rename from src/main/java/fr/greencodeinitiative/python/checks/AvoidListComprehensionInIterations.java rename to src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidListComprehensionInIterations.java index c92f22f..ad3f779 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/AvoidListComprehensionInIterations.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidListComprehensionInIterations.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.sonar.check.Rule; import org.sonar.plugins.python.api.PythonSubscriptionCheck; @@ -26,6 +26,7 @@ import org.sonar.plugins.python.api.tree.ForStatement; import org.sonar.plugins.python.api.tree.Tree; import org.sonar.plugins.python.api.tree.RegularArgument; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; import java.util.Objects; @@ -35,6 +36,7 @@ import static org.sonar.plugins.python.api.tree.Tree.Kind.REGULAR_ARGUMENT; @Rule(key = "EC404") +@DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC404") public class AvoidListComprehensionInIterations extends PythonSubscriptionCheck { public static final String DESCRIPTION = "Use generator comprehension instead of list comprehension in for loop declaration"; diff --git a/src/main/java/fr/greencodeinitiative/python/checks/AvoidMultipleIfElseStatementCheck.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidMultipleIfElseStatementCheck.java similarity index 98% rename from src/main/java/fr/greencodeinitiative/python/checks/AvoidMultipleIfElseStatementCheck.java rename to src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidMultipleIfElseStatementCheck.java index ad39168..7a389a3 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/AvoidMultipleIfElseStatementCheck.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidMultipleIfElseStatementCheck.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import java.util.HashMap; import java.util.List; @@ -31,6 +31,8 @@ import org.sonar.plugins.python.api.tree.IfStatement; import org.sonar.plugins.python.api.tree.Statement; import org.sonar.plugins.python.api.tree.Tree; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; + import static org.sonar.plugins.python.api.tree.Tree.Kind.*; /** @@ -43,6 +45,7 @@ * - IF and ELSEIF statements are considered as an IF statement */ @Rule(key = "EC2") +@DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC2") public class AvoidMultipleIfElseStatementCheck extends PythonSubscriptionCheck { public static final String ERROR_MESSAGE = "Use a match-case statement instead of multiple if-else if possible"; diff --git a/src/main/java/fr/greencodeinitiative/python/checks/AvoidSQLRequestInLoop.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidSQLRequestInLoop.java similarity index 95% rename from src/main/java/fr/greencodeinitiative/python/checks/AvoidSQLRequestInLoop.java rename to src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidSQLRequestInLoop.java index f7ef686..53698d3 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/AvoidSQLRequestInLoop.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidSQLRequestInLoop.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import java.util.Arrays; import java.util.HashSet; @@ -37,6 +37,7 @@ import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; @Rule(key = "EC72") +@DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC72") @DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "S72") public class AvoidSQLRequestInLoop extends PythonSubscriptionCheck { diff --git a/src/main/java/fr/greencodeinitiative/python/checks/AvoidTryCatchWithFileOpenedCheck.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidTryCatchWithFileOpenedCheck.java similarity index 93% rename from src/main/java/fr/greencodeinitiative/python/checks/AvoidTryCatchWithFileOpenedCheck.java rename to src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidTryCatchWithFileOpenedCheck.java index 79c99b9..6274b3f 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/AvoidTryCatchWithFileOpenedCheck.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidTryCatchWithFileOpenedCheck.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.sonar.check.Rule; import org.sonar.plugins.python.api.PythonSubscriptionCheck; @@ -27,8 +27,8 @@ import static org.sonar.plugins.python.api.tree.Tree.Kind.CALL_EXPR; @Rule(key = "EC35") +@DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC35") @DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "S34") -@DeprecatedRuleKey(ruleKey = "EC34") public class AvoidTryCatchWithFileOpenedCheck extends PythonSubscriptionCheck { public static final String DESCRIPTION = "Avoid the use of try-catch with a file open in try block"; diff --git a/src/main/java/fr/greencodeinitiative/python/checks/AvoidUnlimitedCache.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnlimitedCache.java similarity index 91% rename from src/main/java/fr/greencodeinitiative/python/checks/AvoidUnlimitedCache.java rename to src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnlimitedCache.java index 1fb82c4..db628b4 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/AvoidUnlimitedCache.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnlimitedCache.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.sonar.check.Rule; import org.sonar.plugins.python.api.PythonSubscriptionCheck; @@ -26,8 +26,10 @@ import org.sonar.plugins.python.api.tree.Name; import org.sonar.plugins.python.api.tree.RegularArgument; import org.sonar.plugins.python.api.tree.Tree; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; @Rule(key = "EC89") +@DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC89") public class AvoidUnlimitedCache extends PythonSubscriptionCheck { public static final String DESCRIPTION = "Do not set cache size to unlimited"; @@ -75,7 +77,7 @@ private boolean isLruCacheDecorator(Decorator decorator) { private boolean isDecorator(Decorator decorator, String expression) { Name name = null; - // Manage decarator detected as simple expression + // Manage decorator detected as simple expression if (decorator.expression().is(Tree.Kind.NAME)) { name = (Name) decorator.expression(); // manage decorator detected as callable expression diff --git a/src/main/java/fr/greencodeinitiative/python/checks/AvoidUnoptimizedVectorImagesCheck.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnoptimizedVectorImagesCheck.java similarity index 92% rename from src/main/java/fr/greencodeinitiative/python/checks/AvoidUnoptimizedVectorImagesCheck.java rename to src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnoptimizedVectorImagesCheck.java index 4fa44f8..e235a06 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/AvoidUnoptimizedVectorImagesCheck.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnoptimizedVectorImagesCheck.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -24,8 +24,10 @@ import org.sonar.plugins.python.api.PythonSubscriptionCheck; import org.sonar.plugins.python.api.SubscriptionContext; import org.sonar.plugins.python.api.tree.*; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; @Rule(key = "EC10") +@DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC10") public class AvoidUnoptimizedVectorImagesCheck extends PythonSubscriptionCheck { public static final String DESCRIPTION = "Avoid using unoptimized vector images"; diff --git a/src/main/java/fr/greencodeinitiative/python/checks/DetectUnoptimizedImageFormat.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/DetectUnoptimizedImageFormat.java similarity index 71% rename from src/main/java/fr/greencodeinitiative/python/checks/DetectUnoptimizedImageFormat.java rename to src/main/java/org/greencodeinitiative/creedengo/python/checks/DetectUnoptimizedImageFormat.java index e5d1daf..fedd64c 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/DetectUnoptimizedImageFormat.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/DetectUnoptimizedImageFormat.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,24 +15,24 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.sonar.check.Rule; import org.sonar.plugins.python.api.PythonSubscriptionCheck; import org.sonar.plugins.python.api.SubscriptionContext; import org.sonar.plugins.python.api.tree.StringLiteral; import org.sonar.plugins.python.api.tree.Tree; +import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; import java.util.regex.Matcher; import java.util.regex.Pattern; @Rule(key = "EC203") +@DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC203") public class DetectUnoptimizedImageFormat extends PythonSubscriptionCheck { - protected static final String RULE_KEY = "EC203"; - protected static final String MESSAGERULE = "Detect unoptimized image format"; - protected static final String MESSAGEERROR = "If possible, the utilisation of svg image format (or html tag) is recommended over other image format."; - protected static final Pattern IMGEXTENSION = Pattern.compile("\\.(bmp|ico|tiff|webp|png|jpg|jpeg|jfif|pjpeg|pjp|gif|avif|apng)"); + protected static final String MESSAGE_ERROR = "If possible, the utilisation of svg image format (or html tag) is recommended over other image format."; + protected static final Pattern IMG_EXTENSION = Pattern.compile("\\.(bmp|ico|tiff|webp|png|jpg|jpeg|jfif|pjpeg|pjp|gif|avif|apng)"); @Override public void initialize(Context context) { @@ -43,9 +43,9 @@ public void visitNodeString(SubscriptionContext ctx) { if (ctx.syntaxNode().is(Tree.Kind.STRING_LITERAL)) { final StringLiteral stringLiteral = (StringLiteral) ctx.syntaxNode(); final String strValue = stringLiteral.trimmedQuotesValue(); - final Matcher matcher = IMGEXTENSION.matcher(strValue); + final Matcher matcher = IMG_EXTENSION.matcher(strValue); if(matcher.find()) { - ctx.addIssue(stringLiteral, MESSAGEERROR); + ctx.addIssue(stringLiteral, MESSAGE_ERROR); } } } diff --git a/src/main/java/fr/greencodeinitiative/python/package-info.java b/src/main/java/org/greencodeinitiative/creedengo/python/package-info.java similarity index 88% rename from src/main/java/fr/greencodeinitiative/python/package-info.java rename to src/main/java/org/greencodeinitiative/creedengo/python/package-info.java index 2c0f306..6836e11 100644 --- a/src/main/java/fr/greencodeinitiative/python/package-info.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/package-info.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -16,7 +16,7 @@ * along with this program. If not, see . */ @ParametersAreNonnullByDefault -package fr.greencodeinitiative.python; +package org.greencodeinitiative.creedengo.python; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/test/java/fr/greencodeinitiative/python/PythonPluginTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/PythonPluginTest.java similarity index 92% rename from src/test/java/fr/greencodeinitiative/python/PythonPluginTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/PythonPluginTest.java index 033beb1..5a1c1c6 100644 --- a/src/test/java/fr/greencodeinitiative/python/PythonPluginTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/PythonPluginTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python; +package org.greencodeinitiative.creedengo.python; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/fr/greencodeinitiative/python/PythonRuleRepositoryTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/PythonRuleRepositoryTest.java similarity index 93% rename from src/test/java/fr/greencodeinitiative/python/PythonRuleRepositoryTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/PythonRuleRepositoryTest.java index 8fa5767..b9ed010 100644 --- a/src/test/java/fr/greencodeinitiative/python/PythonRuleRepositoryTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/PythonRuleRepositoryTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python; +package org.greencodeinitiative.creedengo.python; import org.assertj.core.api.SoftAssertions; import org.junit.jupiter.api.BeforeEach; @@ -51,9 +51,9 @@ void init() { @Test @DisplayName("Test repository metadata") void testMetadata() { - assertThat(repository.name()).isEqualTo("ecoCode"); + assertThat(repository.name()).isEqualTo("creedengo"); assertThat(repository.language()).isEqualTo("py"); - assertThat(repository.key()).isEqualTo("ecocode-python"); + assertThat(repository.key()).isEqualTo("creedengo-python"); } @Test diff --git a/src/test/java/fr/greencodeinitiative/python/checks/AvoidFullSQLRequestTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidFullSQLRequestTest.java similarity index 89% rename from src/test/java/fr/greencodeinitiative/python/checks/AvoidFullSQLRequestTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidFullSQLRequestTest.java index 1d0ae34..f9ee5f7 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/AvoidFullSQLRequestTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidFullSQLRequestTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.junit.Test; import org.sonar.python.checks.utils.PythonCheckVerifier; diff --git a/src/test/java/fr/greencodeinitiative/python/checks/AvoidGettersAndSettersTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidGettersAndSettersTest.java similarity index 90% rename from src/test/java/fr/greencodeinitiative/python/checks/AvoidGettersAndSettersTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidGettersAndSettersTest.java index fb14108..c5d174d 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/AvoidGettersAndSettersTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidGettersAndSettersTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.junit.Test; import org.sonar.python.checks.utils.PythonCheckVerifier; diff --git a/src/test/java/fr/greencodeinitiative/python/checks/AvoidGlobalVariableInFunctionCheckTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidGlobalVariableInFunctionCheckTest.java similarity index 82% rename from src/test/java/fr/greencodeinitiative/python/checks/AvoidGlobalVariableInFunctionCheckTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidGlobalVariableInFunctionCheckTest.java index bd46542..cd933fe 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/AvoidGlobalVariableInFunctionCheckTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidGlobalVariableInFunctionCheckTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.junit.Test; import org.sonar.python.checks.utils.PythonCheckVerifier; @@ -24,7 +24,6 @@ public class AvoidGlobalVariableInFunctionCheckTest { @Test public void test() { PythonCheckVerifier.verify("src/test/resources/checks/avoidGlobalVariableInFunctionNonCompliant.py", new AvoidGlobalVariableInFunctionCheck()); - //PythonCheckVerifier.verifyNoIssue("src/test/resources/checks/avoidGlobalVariableInFunctionCompliant.py", new AvoidGlobalVariableInFunctionCheck()); PythonCheckVerifier.verify("src/test/resources/checks/avoidGlobalVariableInFunctionNonCompliant2.py", new AvoidGlobalVariableInFunctionCheck()); } } diff --git a/src/test/java/fr/greencodeinitiative/python/checks/AvoidListComprehensionInIterationsTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidListComprehensionInIterationsTest.java similarity index 90% rename from src/test/java/fr/greencodeinitiative/python/checks/AvoidListComprehensionInIterationsTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidListComprehensionInIterationsTest.java index 798f373..d9f0540 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/AvoidListComprehensionInIterationsTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidListComprehensionInIterationsTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.junit.Test; import org.sonar.python.checks.utils.PythonCheckVerifier; diff --git a/src/test/java/fr/greencodeinitiative/python/checks/AvoidMultipleIfElseStatementCheckTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidMultipleIfElseStatementCheckTest.java similarity index 91% rename from src/test/java/fr/greencodeinitiative/python/checks/AvoidMultipleIfElseStatementCheckTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidMultipleIfElseStatementCheckTest.java index 0e55399..011a54d 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/AvoidMultipleIfElseStatementCheckTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidMultipleIfElseStatementCheckTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.junit.Test; import org.sonar.python.checks.utils.PythonCheckVerifier; diff --git a/src/test/java/fr/greencodeinitiative/python/checks/AvoidSQLRequestInLoopTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidSQLRequestInLoopTest.java similarity index 90% rename from src/test/java/fr/greencodeinitiative/python/checks/AvoidSQLRequestInLoopTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidSQLRequestInLoopTest.java index d9e6bda..d499b46 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/AvoidSQLRequestInLoopTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidSQLRequestInLoopTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.junit.Test; import org.sonar.python.checks.utils.PythonCheckVerifier; diff --git a/src/test/java/fr/greencodeinitiative/python/checks/AvoidTryCatchWithFileOpenedCheckTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidTryCatchWithFileOpenedCheckTest.java similarity index 90% rename from src/test/java/fr/greencodeinitiative/python/checks/AvoidTryCatchWithFileOpenedCheckTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidTryCatchWithFileOpenedCheckTest.java index 10498c6..d1947c0 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/AvoidTryCatchWithFileOpenedCheckTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidTryCatchWithFileOpenedCheckTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.junit.Test; diff --git a/src/test/java/fr/greencodeinitiative/python/checks/AvoidUnlimitedCacheTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnlimitedCacheTest.java similarity index 90% rename from src/test/java/fr/greencodeinitiative/python/checks/AvoidUnlimitedCacheTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnlimitedCacheTest.java index 590ad1c..e401955 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/AvoidUnlimitedCacheTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnlimitedCacheTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.junit.Test; import org.sonar.python.checks.utils.PythonCheckVerifier; diff --git a/src/test/java/fr/greencodeinitiative/python/checks/AvoidUnoptimizedVectorImagesTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnoptimizedVectorImagesTest.java similarity index 90% rename from src/test/java/fr/greencodeinitiative/python/checks/AvoidUnoptimizedVectorImagesTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnoptimizedVectorImagesTest.java index 692d534..bb48d52 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/AvoidUnoptimizedVectorImagesTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnoptimizedVectorImagesTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.junit.Test; import org.sonar.python.checks.utils.PythonCheckVerifier; diff --git a/src/test/java/fr/greencodeinitiative/python/checks/DetectUnoptimizedImageFormatTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/checks/DetectUnoptimizedImageFormatTest.java similarity index 91% rename from src/test/java/fr/greencodeinitiative/python/checks/DetectUnoptimizedImageFormatTest.java rename to src/test/java/org/greencodeinitiative/creedengo/python/checks/DetectUnoptimizedImageFormatTest.java index 754b976..b27e965 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/DetectUnoptimizedImageFormatTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/checks/DetectUnoptimizedImageFormatTest.java @@ -1,6 +1,6 @@ /* * creedengo - Python language - Provides rules to reduce the environmental footprint of your Python programs - * Copyright © 2023 Green Code Initiative (https://green-code-initiative.org) + * Copyright © 2024 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 @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package fr.greencodeinitiative.python.checks; +package org.greencodeinitiative.creedengo.python.checks; import org.junit.Test; import org.sonar.python.checks.utils.PythonCheckVerifier; From 9acb824d09a683551f3719fe2e21005de0922d7a Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Wed, 4 Dec 2024 23:35:09 +0100 Subject: [PATCH 02/15] move EC ids to GCI ids --- pom.xml | 8 ++++---- .../creedengo/python/PythonRuleRepository.java | 2 +- .../creedengo/python/checks/AvoidFullSQLRequest.java | 2 +- .../creedengo/python/checks/AvoidGettersAndSetters.java | 2 +- .../python/checks/AvoidGlobalVariableInFunctionCheck.java | 2 +- .../python/checks/AvoidListComprehensionInIterations.java | 2 +- .../python/checks/AvoidMultipleIfElseStatementCheck.java | 2 +- .../creedengo/python/checks/AvoidSQLRequestInLoop.java | 2 +- .../python/checks/AvoidTryCatchWithFileOpenedCheck.java | 2 +- .../creedengo/python/checks/AvoidUnlimitedCache.java | 2 +- .../python/checks/AvoidUnoptimizedVectorImagesCheck.java | 2 +- .../python/checks/DetectUnoptimizedImageFormat.java | 2 +- .../creedengo/python/PythonRuleRepositoryTest.java | 4 ++-- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 3130373..4952770 100644 --- a/pom.xml +++ b/pom.xml @@ -61,15 +61,15 @@ 5.14.1 - 1.6.5 + main-SNAPSHOT - io.ecocode - ecocode-rules-specifications - ${ecocode-rules-specifications.version} + org.green-code-initiative + creedengo-rules-specifications + ${creedengo-rules-specifications.version} python diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/PythonRuleRepository.java b/src/main/java/org/greencodeinitiative/creedengo/python/PythonRuleRepository.java index e7cbff1..c385979 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/PythonRuleRepository.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/PythonRuleRepository.java @@ -45,7 +45,7 @@ public class PythonRuleRepository implements RulesDefinition, PythonCustomRuleRe public static final String LANGUAGE = "py"; public static final String NAME = "creedengo"; - public static final String RESOURCE_BASE_PATH = "io/ecocode/rules/python"; + public static final String RESOURCE_BASE_PATH = "org/green-code-initiative/rules/python"; public static final String REPOSITORY_KEY = "creedengo-python"; private final SonarRuntime sonarRuntime; diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidFullSQLRequest.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidFullSQLRequest.java index 40086f0..e8612b7 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidFullSQLRequest.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidFullSQLRequest.java @@ -32,7 +32,7 @@ import java.util.Map; import java.util.regex.Pattern; -@Rule(key = "EC74") +@Rule(key = "GCI74") @DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC74") @DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "S74") public class AvoidFullSQLRequest extends PythonSubscriptionCheck { diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGettersAndSetters.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGettersAndSetters.java index 8247260..0ceacce 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGettersAndSetters.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGettersAndSetters.java @@ -33,7 +33,7 @@ import org.sonar.plugins.python.api.tree.Tree; import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; -@Rule(key = "EC7") +@Rule(key = "GCI7") @DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC7") @DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "D7") public class AvoidGettersAndSetters extends PythonSubscriptionCheck { diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGlobalVariableInFunctionCheck.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGlobalVariableInFunctionCheck.java index 96a37e3..74f0f30 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGlobalVariableInFunctionCheck.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidGlobalVariableInFunctionCheck.java @@ -78,7 +78,7 @@ import org.sonar.plugins.python.api.tree.YieldStatement; import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; -@Rule(key = "EC4") +@Rule(key = "GCI4") @DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC4") @DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "D4") public class AvoidGlobalVariableInFunctionCheck extends PythonSubscriptionCheck { diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidListComprehensionInIterations.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidListComprehensionInIterations.java index ad3f779..a2b4ca7 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidListComprehensionInIterations.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidListComprehensionInIterations.java @@ -35,7 +35,7 @@ import static org.sonar.plugins.python.api.tree.Tree.Kind.LIST_COMPREHENSION; import static org.sonar.plugins.python.api.tree.Tree.Kind.REGULAR_ARGUMENT; -@Rule(key = "EC404") +@Rule(key = "GCI404") @DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC404") public class AvoidListComprehensionInIterations extends PythonSubscriptionCheck { diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidMultipleIfElseStatementCheck.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidMultipleIfElseStatementCheck.java index 7a389a3..644a765 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidMultipleIfElseStatementCheck.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidMultipleIfElseStatementCheck.java @@ -44,7 +44,7 @@ * - an "ELSE" statement is considered as a second IF statement using the same variables used on previous * - IF and ELSEIF statements are considered as an IF statement */ -@Rule(key = "EC2") +@Rule(key = "GCI2") @DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC2") public class AvoidMultipleIfElseStatementCheck extends PythonSubscriptionCheck { diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidSQLRequestInLoop.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidSQLRequestInLoop.java index 53698d3..7f95fc5 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidSQLRequestInLoop.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidSQLRequestInLoop.java @@ -36,7 +36,7 @@ import org.sonar.plugins.python.api.tree.Tree; import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; -@Rule(key = "EC72") +@Rule(key = "GCI72") @DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC72") @DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "S72") public class AvoidSQLRequestInLoop extends PythonSubscriptionCheck { diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidTryCatchWithFileOpenedCheck.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidTryCatchWithFileOpenedCheck.java index 6274b3f..016d8a0 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidTryCatchWithFileOpenedCheck.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidTryCatchWithFileOpenedCheck.java @@ -26,7 +26,7 @@ import static org.sonar.plugins.python.api.tree.Tree.Kind.CALL_EXPR; -@Rule(key = "EC35") +@Rule(key = "GCI35") @DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC35") @DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "S34") public class AvoidTryCatchWithFileOpenedCheck extends PythonSubscriptionCheck { diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnlimitedCache.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnlimitedCache.java index db628b4..5eb7cd3 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnlimitedCache.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnlimitedCache.java @@ -28,7 +28,7 @@ import org.sonar.plugins.python.api.tree.Tree; import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; -@Rule(key = "EC89") +@Rule(key = "GCI89") @DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC89") public class AvoidUnlimitedCache extends PythonSubscriptionCheck { diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnoptimizedVectorImagesCheck.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnoptimizedVectorImagesCheck.java index e235a06..9ba6f2a 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnoptimizedVectorImagesCheck.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/AvoidUnoptimizedVectorImagesCheck.java @@ -26,7 +26,7 @@ import org.sonar.plugins.python.api.tree.*; import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey; -@Rule(key = "EC10") +@Rule(key = "GCI10") @DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC10") public class AvoidUnoptimizedVectorImagesCheck extends PythonSubscriptionCheck { diff --git a/src/main/java/org/greencodeinitiative/creedengo/python/checks/DetectUnoptimizedImageFormat.java b/src/main/java/org/greencodeinitiative/creedengo/python/checks/DetectUnoptimizedImageFormat.java index fedd64c..985262e 100644 --- a/src/main/java/org/greencodeinitiative/creedengo/python/checks/DetectUnoptimizedImageFormat.java +++ b/src/main/java/org/greencodeinitiative/creedengo/python/checks/DetectUnoptimizedImageFormat.java @@ -27,7 +27,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -@Rule(key = "EC203") +@Rule(key = "GCI203") @DeprecatedRuleKey(repositoryKey = "ecocode-python", ruleKey = "EC203") public class DetectUnoptimizedImageFormat extends PythonSubscriptionCheck { diff --git a/src/test/java/org/greencodeinitiative/creedengo/python/PythonRuleRepositoryTest.java b/src/test/java/org/greencodeinitiative/creedengo/python/PythonRuleRepositoryTest.java index b9ed010..30b4d47 100644 --- a/src/test/java/org/greencodeinitiative/creedengo/python/PythonRuleRepositoryTest.java +++ b/src/test/java/org/greencodeinitiative/creedengo/python/PythonRuleRepositoryTest.java @@ -69,11 +69,11 @@ void checkNumberRules() { } @Test - @DisplayName("All rule keys must be prefixed by 'EC'") + @DisplayName("All rule keys must be prefixed by 'GCI'") void testRuleKeyPrefix() { SoftAssertions assertions = new SoftAssertions(); repository.rules().forEach( - rule -> assertions.assertThat(rule.key()).startsWith("EC") + rule -> assertions.assertThat(rule.key()).startsWith("GCI") ); assertions.assertAll(); } From 8ac69b8e8c3282d023c80ac044abf6fcfbc97780 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Wed, 4 Dec 2024 23:41:51 +0100 Subject: [PATCH 03/15] typo --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4952770..c7bddfd 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 5.14.1 - + main-SNAPSHOT From f35a4f7c221421b7f745bed656e9ce457a088dcf Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Mon, 9 Dec 2024 13:44:20 +0100 Subject: [PATCH 04/15] creedengo updates --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c7bddfd..4a8614a 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 5.14.1 - main-SNAPSHOT + 0.0.3 From a82d48e22587eef3ed7bc34b2469ee934fe74807 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Mon, 9 Dec 2024 13:53:02 +0100 Subject: [PATCH 05/15] creedengo update CI --- .github/workflows/build.yml | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6125ad9..ab08a52 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,11 +25,18 @@ jobs: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: 11 + - name: Cache SonarQube packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages uses: actions/cache@v3 with: @@ -37,24 +44,8 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Verify - run: mvn -e -B verify - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 17 - - - name: Cache SonarQube packages - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: SonarQube Scan + - name: Build and analyze env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -e -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_creedengo-python + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=green-code-initiative_creedengo-python From c78d491b57e2606c29ccc63360c59bf0b46d9b23 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Mon, 9 Dec 2024 17:44:10 +0100 Subject: [PATCH 06/15] update rules-spec + correction creedengo migration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 4a8614a..5f839c3 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 5.14.1 - 0.0.3 + 0.0.4 @@ -221,7 +221,7 @@ - io.ecocode:ecocode-rules-specifications:* + org.green-code-initiative:creedengo-rules-specifications:* META-INF/** From 9fbedca8c80cb255a0107b893abe9c112a342041 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Mon, 9 Dec 2024 17:55:06 +0100 Subject: [PATCH 07/15] creedengo migration - refacto --- CHANGELOG.md | 92 ------------------------------ CHANGELOG_ecocode-python.md | 110 ++++++++++++++++++++++++++++++++++++ README.md | 8 +-- RULES.md | 2 +- 4 files changed, 115 insertions(+), 97 deletions(-) create mode 100644 CHANGELOG_ecocode-python.md diff --git a/CHANGELOG.md b/CHANGELOG.md index f9f70f6..88411f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,96 +15,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deleted -## [1.5.0] - 2024-10-04 - -### Changed - -- refactoring docker system -- [#29](https://github.com/green-code-initiative/creedengo-python/issues/29) Add test to ensure all Rules are registered -- [#24](https://github.com/green-code-initiative/creedengo-python/issues/24) Set correct required language because the - plugin wasn't loaded anymore - retro-compatibility modifications (9.9.0 to 10.7 and not compatible before 9.9.0) AND - add support for > 10.5 Sonarqube version (up to 10.7.0) -- update some maven plugin versions and library versions to be up-to-date -- correction of SonarCloud issues - -### Deleted - -- deletion of EC69 rule because of already deprecated (see RULES.md file) - -## [1.4.4] - 2024-07-18 - -### Added - -- [#26](https://github.com/green-code-initiative/creedengo-python/issues/26) [EC89] Avoid unlimited cache - -### Changed - -- [#22](https://github.com/green-code-initiative/creedengo-python/issues/22) Depreciation of EC69 rule for python because - not relevant (after analysis) - -### Deleted - -- [#22](https://github.com/green-code-initiative/creedengo-python/issues/22) Delete deprecated EC66 rule for Python - -## [1.4.3] - 2024-05-15 - -### Added - -- [#18](https://github.com/green-code-initiative/creedengo-python/issues/18) Add support for SonarQube 10.4 " - DownloadOnlyWhenRequired" feature -- Add Support for SonarQube 10.4.1 - -### Changed - -- [#17](https://github.com/green-code-initiative/creedengo-python/issues/17) EC7 - correction setter problem on - constructor method -- check Sonarqube 10.4.1 compatibility + update docker files and README.md / NOT OK with 10.5.x (issue created) - -## [1.4.2] - 2024-01-11 - -### Changed - -- [#14](https://github.com/green-code-initiative/creedengo-python/issues/14) Correction of error with deprecated EC34 rule -- Update ecocode-rules-specifications to 1.4.7 - -## [1.4.1] - 2024-01-05 - -### Added - -- Add 10.3 SonarQube compatibility - -### Changed - -- [#5](https://github.com/green-code-initiative/creedengo-python/pull/5) Upgrade licence system and licence headers of - Java files -- [#6](https://github.com/green-code-initiative/creedengo-python/pull/6) Adding EC35 rule : EC35 rule replaces EC34 with a - specific use case ("file not found" specific) -- [#7](https://github.com/green-code-initiative/creedengo-python/issues/7) Add build number to manifest -- [#123](https://github.com/green-code-initiative/creedengo/issues/123) Improve unit tests for EC7 rule -- Update ecocode-rules-specifications to 1.4.6 -- README.md upgrade : docker test environment -- [#10](https://github.com/green-code-initiative/creedengo-python/issues/10) Correction of NullPointException in EC2 rule - -### Deleted - -- [#4](https://github.com/green-code-initiative/creedengo-python/issues/4) Deprecate rule EC66 for Python because not - applicable (see details inside issue) - -## [1.4.0] - 2023-08-08 - -### Added - -- Python rules moved from `ecocode` repository to current repository -- [#142](https://github.com/green-code-initiative/creedengo/issues/142) new Python rule : Multiple if-else statement + - refactoring implementation -- [#205](https://github.com/green-code-initiative/creedengo/issues/205) compatibility with SonarQube 10.1 - ## Comparison list - -[unreleased](https://github.com/green-code-initiative/creedengo-python/compare/1.5.0...HEAD) -[1.5.0](https://github.com/green-code-initiative/creedengo-python/compare/1.4.4...1.5.0) -[1.4.4](https://github.com/green-code-initiative/creedengo-python/compare/1.4.3...1.4.4) -[1.4.3](https://github.com/green-code-initiative/creedengo-python/compare/1.4.2...1.4.3) -[1.4.2](https://github.com/green-code-initiative/creedengo-python/compare/1.4.1...1.4.2) -[1.4.1](https://github.com/green-code-initiative/creedengo-python/compare/1.4.0...1.4.1) -[1.4.0](https://github.com/green-code-initiative/creedengo-python/releases/tag/1.4.0) diff --git a/CHANGELOG_ecocode-python.md b/CHANGELOG_ecocode-python.md new file mode 100644 index 0000000..f9f70f6 --- /dev/null +++ b/CHANGELOG_ecocode-python.md @@ -0,0 +1,110 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +### Changed + +- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Strong renaming plugin from `ecocode-python` to `creedengo-python` (and maven groupid from `io.ecocode` to `io.greencodeinitiative`) + +### Deleted + +## [1.5.0] - 2024-10-04 + +### Changed + +- refactoring docker system +- [#29](https://github.com/green-code-initiative/creedengo-python/issues/29) Add test to ensure all Rules are registered +- [#24](https://github.com/green-code-initiative/creedengo-python/issues/24) Set correct required language because the + plugin wasn't loaded anymore - retro-compatibility modifications (9.9.0 to 10.7 and not compatible before 9.9.0) AND + add support for > 10.5 Sonarqube version (up to 10.7.0) +- update some maven plugin versions and library versions to be up-to-date +- correction of SonarCloud issues + +### Deleted + +- deletion of EC69 rule because of already deprecated (see RULES.md file) + +## [1.4.4] - 2024-07-18 + +### Added + +- [#26](https://github.com/green-code-initiative/creedengo-python/issues/26) [EC89] Avoid unlimited cache + +### Changed + +- [#22](https://github.com/green-code-initiative/creedengo-python/issues/22) Depreciation of EC69 rule for python because + not relevant (after analysis) + +### Deleted + +- [#22](https://github.com/green-code-initiative/creedengo-python/issues/22) Delete deprecated EC66 rule for Python + +## [1.4.3] - 2024-05-15 + +### Added + +- [#18](https://github.com/green-code-initiative/creedengo-python/issues/18) Add support for SonarQube 10.4 " + DownloadOnlyWhenRequired" feature +- Add Support for SonarQube 10.4.1 + +### Changed + +- [#17](https://github.com/green-code-initiative/creedengo-python/issues/17) EC7 - correction setter problem on + constructor method +- check Sonarqube 10.4.1 compatibility + update docker files and README.md / NOT OK with 10.5.x (issue created) + +## [1.4.2] - 2024-01-11 + +### Changed + +- [#14](https://github.com/green-code-initiative/creedengo-python/issues/14) Correction of error with deprecated EC34 rule +- Update ecocode-rules-specifications to 1.4.7 + +## [1.4.1] - 2024-01-05 + +### Added + +- Add 10.3 SonarQube compatibility + +### Changed + +- [#5](https://github.com/green-code-initiative/creedengo-python/pull/5) Upgrade licence system and licence headers of + Java files +- [#6](https://github.com/green-code-initiative/creedengo-python/pull/6) Adding EC35 rule : EC35 rule replaces EC34 with a + specific use case ("file not found" specific) +- [#7](https://github.com/green-code-initiative/creedengo-python/issues/7) Add build number to manifest +- [#123](https://github.com/green-code-initiative/creedengo/issues/123) Improve unit tests for EC7 rule +- Update ecocode-rules-specifications to 1.4.6 +- README.md upgrade : docker test environment +- [#10](https://github.com/green-code-initiative/creedengo-python/issues/10) Correction of NullPointException in EC2 rule + +### Deleted + +- [#4](https://github.com/green-code-initiative/creedengo-python/issues/4) Deprecate rule EC66 for Python because not + applicable (see details inside issue) + +## [1.4.0] - 2023-08-08 + +### Added + +- Python rules moved from `ecocode` repository to current repository +- [#142](https://github.com/green-code-initiative/creedengo/issues/142) new Python rule : Multiple if-else statement + + refactoring implementation +- [#205](https://github.com/green-code-initiative/creedengo/issues/205) compatibility with SonarQube 10.1 + +## Comparison list + +[unreleased](https://github.com/green-code-initiative/creedengo-python/compare/1.5.0...HEAD) +[1.5.0](https://github.com/green-code-initiative/creedengo-python/compare/1.4.4...1.5.0) +[1.4.4](https://github.com/green-code-initiative/creedengo-python/compare/1.4.3...1.4.4) +[1.4.3](https://github.com/green-code-initiative/creedengo-python/compare/1.4.2...1.4.3) +[1.4.2](https://github.com/green-code-initiative/creedengo-python/compare/1.4.1...1.4.2) +[1.4.1](https://github.com/green-code-initiative/creedengo-python/compare/1.4.0...1.4.1) +[1.4.0](https://github.com/green-code-initiative/creedengo-python/releases/tag/1.4.0) diff --git a/README.md b/README.md index 1285827..b0591f7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ _creedengo_ is a collective project aiming to reduce environmental footprint of the project is to provide a list of static code analyzers to highlight code structures that may have a negative ecological impact: energy and resources over-consumption, "fatware", shortening terminals' lifespan, etc. -_ecoCode_ is based on evolving catalogs +_creedengo_ is based on evolving catalogs of [good practices](https://github.com/green-code-initiative/ecoCode/blob/main/docs/rules), for various technologies. This SonarQube plugin then implements these catalogs as rules for scanning your Python projects. @@ -69,17 +69,17 @@ Ready to use binaries are available [from GitHub](https://github.com/green-code- | 1.4.+ | 9.4.+ LTS to 10.4.1 | 11 / 17 | > Compatibility table of versions lower than 1.4.+ are available from the -> main [ecoCode repository](https://github.com/green-code-initiative/ecoCode#-plugins-version-compatibility). +> main [creedengo repository](https://github.com/green-code-initiative/ecoCode#-plugins-version-compatibility). 🤝 Contribution --------------- -check [ecoCode repository](https://github.com/green-code-initiative/ecoCode#-contribution) +check [creedengo repository](https://github.com/green-code-initiative/ecoCode#-contribution) 🤓 Main contributors -------------------- -check [ecoCode repository](https://github.com/green-code-initiative/ecoCode#-main-contributors) +check [creedengo repository](https://github.com/green-code-initiative/ecoCode#-main-contributors) Links ----- diff --git a/RULES.md b/RULES.md index 13bf375..82af885 100644 --- a/RULES.md +++ b/RULES.md @@ -1 +1 @@ -Please read [RULES.md](https://github.com/green-code-initiative/ecoCode/blob/main/RULES.md) in `ecoCode` repository. +Please read [RULES.md](https://github.com/green-code-initiative/ecoCode/blob/main/RULES.md) in `creedengo` repository. From a234476d0c96ccf8ecd22e9ba630506920250581 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Mon, 9 Dec 2024 18:43:07 +0100 Subject: [PATCH 08/15] update creedengo-rules-spec + update CHANGELOG --- CHANGELOG.md | 5 ++++- pom.xml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88411f6..51de4e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Strong renaming plugin from `ecocode-python` to `creedengo-python` (and maven groupid from `io.ecocode` to `io.greencodeinitiative`) +- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Migration from `ecocode-python` to `creedengo-python` ### Deleted ## Comparison list + +[unreleased](https://github.com/green-code-initiative/creedengo-python/compare/1.0.0...HEAD) +[1.1.0](https://github.com/green-code-initiative/creedengo-python/releases/tag/1.0.0) \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5f839c3..4355f9c 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 5.14.1 - 0.0.4 + 1.0.0 From 3ac4a27bd341ab11adfb4d5172d1e5cbe719d0a1 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Mon, 9 Dec 2024 22:44:58 +0100 Subject: [PATCH 09/15] prepare 1.0.0 : update CHANGELOG --- CHANGELOG.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51de4e8..5943f11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,11 +11,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Migration from `ecocode-python` to `creedengo-python` - ### Deleted +## [1.0.0] - 2024-12-09 + +### Changed + +- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Migration from `ecocode-python` to `creedengo-python` + ## Comparison list [unreleased](https://github.com/green-code-initiative/creedengo-python/compare/1.0.0...HEAD) -[1.1.0](https://github.com/green-code-initiative/creedengo-python/releases/tag/1.0.0) \ No newline at end of file +[1.0.0](https://github.com/green-code-initiative/creedengo-python/releases/tag/1.0.0) \ No newline at end of file From 0c4e8758b7f7e1f7907522a93d5f514c3a7c889c Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Thu, 12 Dec 2024 21:54:10 +0100 Subject: [PATCH 10/15] end of creedengo migration --- CHANGELOG.md | 93 ++++++++++++++++++++++++++++-- CHANGELOG_ecocode-python.md | 110 ------------------------------------ README.md | 8 +-- RULES.md | 2 +- pom.xml | 2 +- 5 files changed, 95 insertions(+), 120 deletions(-) delete mode 100644 CHANGELOG_ecocode-python.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 5943f11..f9f70f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,15 +11,100 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Strong renaming plugin from `ecocode-python` to `creedengo-python` (and maven groupid from `io.ecocode` to `io.greencodeinitiative`) + +### Deleted + +## [1.5.0] - 2024-10-04 + +### Changed + +- refactoring docker system +- [#29](https://github.com/green-code-initiative/creedengo-python/issues/29) Add test to ensure all Rules are registered +- [#24](https://github.com/green-code-initiative/creedengo-python/issues/24) Set correct required language because the + plugin wasn't loaded anymore - retro-compatibility modifications (9.9.0 to 10.7 and not compatible before 9.9.0) AND + add support for > 10.5 Sonarqube version (up to 10.7.0) +- update some maven plugin versions and library versions to be up-to-date +- correction of SonarCloud issues + ### Deleted -## [1.0.0] - 2024-12-09 +- deletion of EC69 rule because of already deprecated (see RULES.md file) + +## [1.4.4] - 2024-07-18 + +### Added + +- [#26](https://github.com/green-code-initiative/creedengo-python/issues/26) [EC89] Avoid unlimited cache ### Changed -- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Migration from `ecocode-python` to `creedengo-python` +- [#22](https://github.com/green-code-initiative/creedengo-python/issues/22) Depreciation of EC69 rule for python because + not relevant (after analysis) + +### Deleted + +- [#22](https://github.com/green-code-initiative/creedengo-python/issues/22) Delete deprecated EC66 rule for Python + +## [1.4.3] - 2024-05-15 + +### Added + +- [#18](https://github.com/green-code-initiative/creedengo-python/issues/18) Add support for SonarQube 10.4 " + DownloadOnlyWhenRequired" feature +- Add Support for SonarQube 10.4.1 + +### Changed + +- [#17](https://github.com/green-code-initiative/creedengo-python/issues/17) EC7 - correction setter problem on + constructor method +- check Sonarqube 10.4.1 compatibility + update docker files and README.md / NOT OK with 10.5.x (issue created) + +## [1.4.2] - 2024-01-11 + +### Changed + +- [#14](https://github.com/green-code-initiative/creedengo-python/issues/14) Correction of error with deprecated EC34 rule +- Update ecocode-rules-specifications to 1.4.7 + +## [1.4.1] - 2024-01-05 + +### Added + +- Add 10.3 SonarQube compatibility + +### Changed + +- [#5](https://github.com/green-code-initiative/creedengo-python/pull/5) Upgrade licence system and licence headers of + Java files +- [#6](https://github.com/green-code-initiative/creedengo-python/pull/6) Adding EC35 rule : EC35 rule replaces EC34 with a + specific use case ("file not found" specific) +- [#7](https://github.com/green-code-initiative/creedengo-python/issues/7) Add build number to manifest +- [#123](https://github.com/green-code-initiative/creedengo/issues/123) Improve unit tests for EC7 rule +- Update ecocode-rules-specifications to 1.4.6 +- README.md upgrade : docker test environment +- [#10](https://github.com/green-code-initiative/creedengo-python/issues/10) Correction of NullPointException in EC2 rule + +### Deleted + +- [#4](https://github.com/green-code-initiative/creedengo-python/issues/4) Deprecate rule EC66 for Python because not + applicable (see details inside issue) + +## [1.4.0] - 2023-08-08 + +### Added + +- Python rules moved from `ecocode` repository to current repository +- [#142](https://github.com/green-code-initiative/creedengo/issues/142) new Python rule : Multiple if-else statement + + refactoring implementation +- [#205](https://github.com/green-code-initiative/creedengo/issues/205) compatibility with SonarQube 10.1 ## Comparison list -[unreleased](https://github.com/green-code-initiative/creedengo-python/compare/1.0.0...HEAD) -[1.0.0](https://github.com/green-code-initiative/creedengo-python/releases/tag/1.0.0) \ No newline at end of file +[unreleased](https://github.com/green-code-initiative/creedengo-python/compare/1.5.0...HEAD) +[1.5.0](https://github.com/green-code-initiative/creedengo-python/compare/1.4.4...1.5.0) +[1.4.4](https://github.com/green-code-initiative/creedengo-python/compare/1.4.3...1.4.4) +[1.4.3](https://github.com/green-code-initiative/creedengo-python/compare/1.4.2...1.4.3) +[1.4.2](https://github.com/green-code-initiative/creedengo-python/compare/1.4.1...1.4.2) +[1.4.1](https://github.com/green-code-initiative/creedengo-python/compare/1.4.0...1.4.1) +[1.4.0](https://github.com/green-code-initiative/creedengo-python/releases/tag/1.4.0) diff --git a/CHANGELOG_ecocode-python.md b/CHANGELOG_ecocode-python.md deleted file mode 100644 index f9f70f6..0000000 --- a/CHANGELOG_ecocode-python.md +++ /dev/null @@ -1,110 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -### Added - -### Changed - -- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Strong renaming plugin from `ecocode-python` to `creedengo-python` (and maven groupid from `io.ecocode` to `io.greencodeinitiative`) - -### Deleted - -## [1.5.0] - 2024-10-04 - -### Changed - -- refactoring docker system -- [#29](https://github.com/green-code-initiative/creedengo-python/issues/29) Add test to ensure all Rules are registered -- [#24](https://github.com/green-code-initiative/creedengo-python/issues/24) Set correct required language because the - plugin wasn't loaded anymore - retro-compatibility modifications (9.9.0 to 10.7 and not compatible before 9.9.0) AND - add support for > 10.5 Sonarqube version (up to 10.7.0) -- update some maven plugin versions and library versions to be up-to-date -- correction of SonarCloud issues - -### Deleted - -- deletion of EC69 rule because of already deprecated (see RULES.md file) - -## [1.4.4] - 2024-07-18 - -### Added - -- [#26](https://github.com/green-code-initiative/creedengo-python/issues/26) [EC89] Avoid unlimited cache - -### Changed - -- [#22](https://github.com/green-code-initiative/creedengo-python/issues/22) Depreciation of EC69 rule for python because - not relevant (after analysis) - -### Deleted - -- [#22](https://github.com/green-code-initiative/creedengo-python/issues/22) Delete deprecated EC66 rule for Python - -## [1.4.3] - 2024-05-15 - -### Added - -- [#18](https://github.com/green-code-initiative/creedengo-python/issues/18) Add support for SonarQube 10.4 " - DownloadOnlyWhenRequired" feature -- Add Support for SonarQube 10.4.1 - -### Changed - -- [#17](https://github.com/green-code-initiative/creedengo-python/issues/17) EC7 - correction setter problem on - constructor method -- check Sonarqube 10.4.1 compatibility + update docker files and README.md / NOT OK with 10.5.x (issue created) - -## [1.4.2] - 2024-01-11 - -### Changed - -- [#14](https://github.com/green-code-initiative/creedengo-python/issues/14) Correction of error with deprecated EC34 rule -- Update ecocode-rules-specifications to 1.4.7 - -## [1.4.1] - 2024-01-05 - -### Added - -- Add 10.3 SonarQube compatibility - -### Changed - -- [#5](https://github.com/green-code-initiative/creedengo-python/pull/5) Upgrade licence system and licence headers of - Java files -- [#6](https://github.com/green-code-initiative/creedengo-python/pull/6) Adding EC35 rule : EC35 rule replaces EC34 with a - specific use case ("file not found" specific) -- [#7](https://github.com/green-code-initiative/creedengo-python/issues/7) Add build number to manifest -- [#123](https://github.com/green-code-initiative/creedengo/issues/123) Improve unit tests for EC7 rule -- Update ecocode-rules-specifications to 1.4.6 -- README.md upgrade : docker test environment -- [#10](https://github.com/green-code-initiative/creedengo-python/issues/10) Correction of NullPointException in EC2 rule - -### Deleted - -- [#4](https://github.com/green-code-initiative/creedengo-python/issues/4) Deprecate rule EC66 for Python because not - applicable (see details inside issue) - -## [1.4.0] - 2023-08-08 - -### Added - -- Python rules moved from `ecocode` repository to current repository -- [#142](https://github.com/green-code-initiative/creedengo/issues/142) new Python rule : Multiple if-else statement + - refactoring implementation -- [#205](https://github.com/green-code-initiative/creedengo/issues/205) compatibility with SonarQube 10.1 - -## Comparison list - -[unreleased](https://github.com/green-code-initiative/creedengo-python/compare/1.5.0...HEAD) -[1.5.0](https://github.com/green-code-initiative/creedengo-python/compare/1.4.4...1.5.0) -[1.4.4](https://github.com/green-code-initiative/creedengo-python/compare/1.4.3...1.4.4) -[1.4.3](https://github.com/green-code-initiative/creedengo-python/compare/1.4.2...1.4.3) -[1.4.2](https://github.com/green-code-initiative/creedengo-python/compare/1.4.1...1.4.2) -[1.4.1](https://github.com/green-code-initiative/creedengo-python/compare/1.4.0...1.4.1) -[1.4.0](https://github.com/green-code-initiative/creedengo-python/releases/tag/1.4.0) diff --git a/README.md b/README.md index b0591f7..d47590d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ the project is to provide a list of static code analyzers to highlight code stru ecological impact: energy and resources over-consumption, "fatware", shortening terminals' lifespan, etc. _creedengo_ is based on evolving catalogs -of [good practices](https://github.com/green-code-initiative/ecoCode/blob/main/docs/rules), for various technologies. +of [good practices](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/docs/rules), for various technologies. This SonarQube plugin then implements these catalogs as rules for scanning your Python projects. @@ -69,17 +69,17 @@ Ready to use binaries are available [from GitHub](https://github.com/green-code- | 1.4.+ | 9.4.+ LTS to 10.4.1 | 11 / 17 | > Compatibility table of versions lower than 1.4.+ are available from the -> main [creedengo repository](https://github.com/green-code-initiative/ecoCode#-plugins-version-compatibility). +> main [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications#-plugins-version-compatibility). 🤝 Contribution --------------- -check [creedengo repository](https://github.com/green-code-initiative/ecoCode#-contribution) +check [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications#-contribution) 🤓 Main contributors -------------------- -check [creedengo repository](https://github.com/green-code-initiative/ecoCode#-main-contributors) +check [creedengo repository](https://github.com/green-code-initiative/creedengo-rules-specifications#-main-contributors) Links ----- diff --git a/RULES.md b/RULES.md index 82af885..29d1d91 100644 --- a/RULES.md +++ b/RULES.md @@ -1 +1 @@ -Please read [RULES.md](https://github.com/green-code-initiative/ecoCode/blob/main/RULES.md) in `creedengo` repository. +Please read [RULES.md](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/RULES.md) in `creedengo` repository. diff --git a/pom.xml b/pom.xml index 4355f9c..3049fe3 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 5.14.1 - 1.0.0 + 2.0.0 From e869b97dce29f3542df28ef4d4c41807a51babb5 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Thu, 12 Dec 2024 21:58:39 +0100 Subject: [PATCH 11/15] end of creedengo migration - update version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3049fe3..d8cff3b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.green-code-initiative creedengo-python-plugin - 1.0.0-SNAPSHOT + 2.0.0-SNAPSHOT sonar-plugin creedengo - Python language From 1e414831e40573aea263c49272a8a616c31fdfee Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Thu, 12 Dec 2024 22:53:57 +0100 Subject: [PATCH 12/15] update CHANGELOG for 2.0.0 release --- CHANGELOG.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9f70f6..0d950b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Strong renaming plugin from `ecocode-python` to `creedengo-python` (and maven groupid from `io.ecocode` to `io.greencodeinitiative`) - ### Deleted +## [2.0.0] - 2024-12-12 + +### Changed + +- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Strong renaming plugin from `ecocode-python` to `creedengo-python` (and maven groupid from `io.ecocode` to `io.greencodeinitiative`) + ## [1.5.0] - 2024-10-04 ### Changed @@ -101,7 +105,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Comparison list -[unreleased](https://github.com/green-code-initiative/creedengo-python/compare/1.5.0...HEAD) +[unreleased](https://github.com/green-code-initiative/creedengo-python/compare/2.0.0...HEAD) +[2.0.0](https://github.com/green-code-initiative/creedengo-python/compare/1.4.4...2.0.0) [1.5.0](https://github.com/green-code-initiative/creedengo-python/compare/1.4.4...1.5.0) [1.4.4](https://github.com/green-code-initiative/creedengo-python/compare/1.4.3...1.4.4) [1.4.3](https://github.com/green-code-initiative/creedengo-python/compare/1.4.2...1.4.3) From f08d863dc254db688de177349d963ee05c4d385a Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Thu, 12 Dec 2024 22:54:17 +0100 Subject: [PATCH 13/15] [maven-release-plugin] prepare release 2.0.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d8cff3b..d039687 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.green-code-initiative creedengo-python-plugin - 2.0.0-SNAPSHOT + 2.0.0 sonar-plugin creedengo - Python language @@ -27,7 +27,7 @@ scm:git:https://github.com/green-code-initiative/creedengo-python scm:git:https://github.com/green-code-initiative/creedengo-python https://github.com/green-code-initiative/creedengo-python - HEAD + 2.0.0 GitHub From 2bb2cf18ca918be7a0c2e75b26b6fd9d7a26fbab Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Thu, 12 Dec 2024 22:54:17 +0100 Subject: [PATCH 14/15] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d039687..6a2dab3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.green-code-initiative creedengo-python-plugin - 2.0.0 + 2.0.1-SNAPSHOT sonar-plugin creedengo - Python language @@ -27,7 +27,7 @@ scm:git:https://github.com/green-code-initiative/creedengo-python scm:git:https://github.com/green-code-initiative/creedengo-python https://github.com/green-code-initiative/creedengo-python - 2.0.0 + HEAD GitHub From 0b5d21f7df438cedee4176cce494f0bdd4a20c39 Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Fri, 13 Dec 2024 12:30:13 +0100 Subject: [PATCH 15/15] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d950b8..b029d72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Strong renaming plugin from `ecocode-python` to `creedengo-python` (and maven groupid from `io.ecocode` to `io.greencodeinitiative`) +- [#43](https://github.com/green-code-initiative/creedengo-python/pull/43) Strong renaming plugin from `ecocode-python` to `creedengo-python` (and maven groupid from `io.ecocode` to `org.green-code-initiative`) ## [1.5.0] - 2024-10-04