Skip to content

Commit

Permalink
SONARPY-2506 Remove use of deprecated qualifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainpiot committed Jan 21, 2025
1 parent af2f019 commit 75f14bf
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
*/
package org.sonar.plugins.python;

import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.Plugin;
import org.sonar.api.PropertyType;
import org.sonar.api.SonarProduct;
import org.sonar.api.SonarRuntime;
import org.sonar.api.config.PropertyDefinition;
import org.sonar.api.resources.Qualifiers;
import org.sonar.plugins.python.api.SonarLintCache;
import org.sonar.plugins.python.bandit.BanditRulesDefinition;
import org.sonar.plugins.python.bandit.BanditSensor;
Expand Down Expand Up @@ -68,7 +68,7 @@ static void addCoberturaExtensions(Plugin.Context context) {
"The reports have to conform to the Cobertura XML format.")
.category(PYTHON_CATEGORY)
.subCategory(TEST_AND_COVERAGE)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.defaultValue(PythonCoverageSensor.DEFAULT_REPORT_PATH)
.multiValues(true)
.build(),
Expand All @@ -80,7 +80,7 @@ static void addCoberturaExtensions(Plugin.Context context) {
"Path to a coverage report. Ant patterns are accepted for relative path. The report has to conform to the Cobertura XML format.")
.category(PYTHON_CATEGORY)
.subCategory(TEST_AND_COVERAGE)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.defaultValue("")
.build(),
PythonCoverageSensor.class);
Expand All @@ -95,7 +95,7 @@ static void addXUnitExtensions(Plugin.Context context) {
"are not found. Disabled by default.")
.category(PYTHON_CATEGORY)
.subCategory(TEST_AND_COVERAGE)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.defaultValue("false")
.type(PropertyType.BOOLEAN)
.build(),
Expand All @@ -106,7 +106,7 @@ static void addXUnitExtensions(Plugin.Context context) {
"conform to the junitreport XML format.")
.category(PYTHON_CATEGORY)
.subCategory(TEST_AND_COVERAGE)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.defaultValue(PythonXUnitSensor.DEFAULT_REPORT_PATH)
.build(),
PythonXUnitSensor.class);
Expand All @@ -119,7 +119,7 @@ static void addBanditExtensions(Plugin.Context context) {
.description("Paths (absolute or relative) to json files with Bandit issues.")
.category(EXTERNAL_ANALYZERS_CATEGORY)
.subCategory(PYTHON_CATEGORY)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.multiValues(true)
.build(),
BanditRulesDefinition.class);
Expand All @@ -132,7 +132,7 @@ static void addPylintExtensions(Plugin.Context context) {
.description("Paths (absolute or relative) to report files with Pylint issues.")
.category(EXTERNAL_ANALYZERS_CATEGORY)
.subCategory(PYTHON_CATEGORY)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.multiValues(true)
.build(),
PylintRulesDefinition.class);
Expand All @@ -145,7 +145,7 @@ static void addFlake8Extensions(Plugin.Context context) {
.description("Paths (absolute or relative) to report files with Flake8 issues.")
.category(EXTERNAL_ANALYZERS_CATEGORY)
.subCategory(PYTHON_CATEGORY)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.multiValues(true)
.build(),
Flake8RulesDefinition.class);
Expand All @@ -158,7 +158,7 @@ static void addMypyExtensions(Plugin.Context context) {
.description("Paths (absolute or relative) to report files with Mypy issues.")
.category(EXTERNAL_ANALYZERS_CATEGORY)
.subCategory(PYTHON_CATEGORY)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.multiValues(true)
.build(),
MypyRulesDefinition.class);
Expand All @@ -171,7 +171,7 @@ static void addRuffExtensions(Plugin.Context context) {
.description("Paths (absolute or relative) to report files with Ruff issues.")
.category(EXTERNAL_ANALYZERS_CATEGORY)
.subCategory(PYTHON_CATEGORY)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.multiValues(true)
.build(),
RuffRulesDefinition.class);
Expand All @@ -185,7 +185,7 @@ static PropertyDefinition buildPythonVersion() {
.multiValues(true)
.category(PYTHON_CATEGORY)
.subCategory(GENERAL)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.build();
}

Expand All @@ -197,7 +197,7 @@ static PropertyDefinition buildIpynbPythonSuffix() {
.multiValues(true)
.category(PYTHON_CATEGORY)
.subCategory(GENERAL)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.defaultValue("ipynb")
.build();
}
Expand All @@ -210,7 +210,7 @@ static PropertyDefinition buildPythonSuffix() {
.multiValues(true)
.category(PYTHON_CATEGORY)
.subCategory(GENERAL)
.onQualifiers(Qualifiers.PROJECT)
.onConfigScopes(Set.of(PropertyDefinition.ConfigScope.PROJECT))
.defaultValue("py")
.build();
}
Expand Down

0 comments on commit 75f14bf

Please sign in to comment.