Skip to content

Commit 62f2536

Browse files
authored
Merge pull request #22 from green-code-initiative/ISSUE_21
[ISSUE 21] depreciate irrelevant EC69 + delete deprecated EC66 + check 10.4.1 SonarQube compatibility
2 parents d49c126 + db4d4b3 commit 62f2536

9 files changed

+15
-93
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Changed
1515

16+
- [#22](https://github.com/green-code-initiative/ecoCode-python/issues/22) Depreciation of EC69 rule for python because not relevant (after analysis)
17+
1618
### Deleted
1719

20+
- [#22](https://github.com/green-code-initiative/ecoCode-python/issues/22) Delete deprecated EC66 rule for Python
21+
1822
## [1.4.3] - 2024-05-15
1923

2024
### Added
2125

2226
- [#18](https://github.com/green-code-initiative/ecoCode-python/issues/18) Add support for SonarQube 10.4 "DownloadOnlyWhenRequired" feature
27+
- Add Support for SonarQube 10.4.1
2328

2429
### Changed
2530

src/main/java/fr/greencodeinitiative/python/PythonRuleRepository.java

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public String repositoryKey() {
5555
@Override
5656
public List<Class> checkClasses() {
5757
return Arrays.asList(
58-
AvoidDoubleQuoteCheck.class,
5958
AvoidGettersAndSetters.class,
6059
AvoidGlobalVariableInFunctionCheck.class,
6160
AvoidSQLRequestInLoop.class,

src/main/java/fr/greencodeinitiative/python/checks/AvoidDoubleQuoteCheck.java

-46
This file was deleted.

src/main/java/fr/greencodeinitiative/python/checks/NoFunctionCallWhenDeclaringForLoop.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
import org.sonar.plugins.python.api.tree.Tree;
2424
import org.sonarsource.analyzer.commons.annotations.DeprecatedRuleKey;
2525

26+
/**
27+
* @deprecated not applicable for Python
28+
* (check discussion inside issue https://github.com/green-code-initiative/ecoCode-python/issues/21)
29+
*/
30+
@Deprecated(forRemoval = true)
2631
@Rule(key = "EC69")
2732
@DeprecatedRuleKey(repositoryKey = "gci-python", ruleKey = "S69")
2833
public class NoFunctionCallWhenDeclaringForLoop extends PythonSubscriptionCheck {
@@ -38,4 +43,4 @@ public void initialize(Context context) {
3843
}
3944
});
4045
}
41-
}
46+
}

src/test/java/fr/greencodeinitiative/python/PythonRuleRepositoryTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void testMetadata() {
7878

7979
@Test
8080
void testRegistredRules() {
81-
assertThat(repository.rules()).hasSize(12);
81+
assertThat(repository.rules()).hasSize(11);
8282
}
8383

8484
@Test

src/test/java/fr/greencodeinitiative/python/checks/AvoidDoubleQuoteTest.java

-29
This file was deleted.

src/test/java/fr/greencodeinitiative/python/checks/NoFunctionCallWhenDeclaringForLoopTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
import org.junit.Test;
2121
import org.sonar.python.checks.utils.PythonCheckVerifier;
2222

23+
@Deprecated
2324
public class NoFunctionCallWhenDeclaringForLoopTest {
2425
@Test
2526
public void test() {
2627
PythonCheckVerifier.verify("src/test/resources/checks/noFunctionCallWhenDeclaringForLoop.py", new NoFunctionCallWhenDeclaringForLoop());
2728
}
28-
}
29+
}

src/test/resources/checks/avoidDoubleQuoteCheck.py

-13
This file was deleted.

src/test/resources/checks/noFunctionCallWhenDeclaringForLoop.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ def my_function():
66
my_function()
77
pass
88

9-
my_function()
9+
my_function()

0 commit comments

Comments
 (0)