Skip to content

Commit 587ac7a

Browse files
Set S5918 scope to ALL (#1174)
1 parent 101ab8d commit 587ac7a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

python-checks/src/main/java/org/sonar/python/checks/tests/ImplicitlySkippedTestCheck.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ public void initialize(Context context) {
101101
});
102102
}
103103

104+
@Override
105+
public CheckScope scope() {
106+
return CheckScope.ALL;
107+
}
108+
104109
private static ReturnStatement getReturnStatementFromFirstIfStatement(FunctionDef functionDef) {
105110
// check first non assignment statement is an if with a return
106111
for (Statement statement : functionDef.body().statements()) {

python-checks/src/test/java/org/sonar/python/checks/tests/ImplicitlySkippedTestCheckTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
package org.sonar.python.checks.tests;
2121

2222
import org.junit.Test;
23+
import org.sonar.plugins.python.api.PythonCheck;
2324
import org.sonar.python.checks.utils.PythonCheckVerifier;
2425

26+
import static org.assertj.core.api.Assertions.assertThat;
27+
2528
public class ImplicitlySkippedTestCheckTest {
2629

2730
@Test
@@ -38,4 +41,10 @@ public void testWithWrapper() {
3841
public void testAnotherLibrary() {
3942
PythonCheckVerifier.verify("src/test/resources/checks/tests/implicitlySkippedTestAnotherLibrary.py", new ImplicitlySkippedTestCheck());
4043
}
44+
45+
@Test
46+
public void test_scope() {
47+
assertThat(new ImplicitlySkippedTestCheck().scope()).isEqualTo(PythonCheck.CheckScope.ALL);
48+
}
49+
4150
}

0 commit comments

Comments
 (0)