From 170e25fde9f5c28db336c5d18f4462013f49036f Mon Sep 17 00:00:00 2001 From: David DE CARVALHO Date: Mon, 11 Dec 2023 11:32:46 +0100 Subject: [PATCH] [ISSUE 4] deprecation of EC66 rule for Python --- CHANGELOG.md | 2 ++ .../python/checks/AvoidDoubleQuoteCheck.java | 5 +++++ .../python/checks/AvoidDoubleQuoteTest.java | 1 + 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d27ed0..ec86c2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deleted +- [#4](https://github.com/green-code-initiative/ecoCode-python/issues/4) Deprecate rule EC66 for Python because not applicable (see details inside issue) + ## [1.4.0] - 2023-08-08 ### Added diff --git a/src/main/java/fr/greencodeinitiative/python/checks/AvoidDoubleQuoteCheck.java b/src/main/java/fr/greencodeinitiative/python/checks/AvoidDoubleQuoteCheck.java index 11ccac3..3925898 100644 --- a/src/main/java/fr/greencodeinitiative/python/checks/AvoidDoubleQuoteCheck.java +++ b/src/main/java/fr/greencodeinitiative/python/checks/AvoidDoubleQuoteCheck.java @@ -23,6 +23,11 @@ import org.sonar.plugins.python.api.tree.StringLiteral; import org.sonar.plugins.python.api.tree.Tree; +/** + * @deprecated not applicable for Python + * (check discussion inside issue https://github.com/green-code-initiative/ecoCode-python/issues/4) + */ +@Deprecated(forRemoval = true) @Rule(key = "EC66") public class AvoidDoubleQuoteCheck extends PythonSubscriptionCheck { public static final String MESSAGE_RULE = "Avoid using quotation mark (\"), prefer using simple quote (')"; diff --git a/src/test/java/fr/greencodeinitiative/python/checks/AvoidDoubleQuoteTest.java b/src/test/java/fr/greencodeinitiative/python/checks/AvoidDoubleQuoteTest.java index 5620e8e..24fce8e 100644 --- a/src/test/java/fr/greencodeinitiative/python/checks/AvoidDoubleQuoteTest.java +++ b/src/test/java/fr/greencodeinitiative/python/checks/AvoidDoubleQuoteTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import org.sonar.python.checks.utils.PythonCheckVerifier; +@Deprecated public class AvoidDoubleQuoteTest { @Test public void test() {