Skip to content

Commit d67ae68

Browse files
committed
fix properties
1 parent e9f8a37 commit d67ae68

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/com/github/_1c_syntax/bsl/sonar/BSLCommunityProperties.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,14 @@ public static List<PropertyDefinition> getProperties() {
6868
LANG_SERVER_DIAGNOSTIC_LANGUAGE_DEFAULT_VALUE)
6969
.type(PropertyType.SINGLE_SELECT_LIST)
7070
.options(Language.RU.getLanguageCode(), Language.EN.getLanguageCode())
71+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.APP, PropertyDefinition.ConfigScope.PROJECT)
7172
.build(),
7273
PropertyDefinitionUtils.newPropertyBuilderBSL(1,
7374
LANG_SERVER_ENABLED_KEY,
7475
"enabled",
7576
LANG_SERVER_ENABLED_DEFAULT_VALUE.toString())
7677
.type(PropertyType.BOOLEAN)
78+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.PROJECT)
7779
.build(),
7880
PropertyDefinitionUtils.newPropertyBuilderBSL(2,
7981
LANG_SERVER_COMPUTE_DIAGNOSTICS_SKIP_SUPPORT_KEY,
@@ -84,24 +86,28 @@ public static List<PropertyDefinition> getProperties() {
8486
.map(value -> value.name().toLowerCase(Locale.ENGLISH).replace("_", " "))
8587
.toList()
8688
)
89+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.PROJECT)
8790
.build(),
8891
PropertyDefinitionUtils.newPropertyBuilderBSL(3,
8992
LANG_SERVER_OVERRIDE_CONFIGURATION_KEY,
9093
"overrideConfiguration",
9194
LANG_SERVER_OVERRIDE_CONFIGURATION_DEFAULT_VALUE.toString())
9295
.type(PropertyType.BOOLEAN)
96+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.PROJECT)
9397
.build(),
9498
PropertyDefinitionUtils.newPropertyBuilderBSL(4,
9599
LANG_SERVER_CONFIGURATION_PATH_KEY,
96100
"enabled.configurationPath",
97101
LANG_SERVER_CONFIGURATION_PATH_DEFAULT_VALUE)
98102
.type(PropertyType.STRING)
103+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.PROJECT)
99104
.build(),
100105
PropertyDefinitionUtils.newPropertyBuilderBSL(5,
101106
LANG_SERVER_SUBSYSTEM_FILTER_INCLUDE_KEY,
102107
"subsystemfilter.include",
103108
"")
104109
.multiValues(true)
110+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.PROJECT)
105111
.build(),
106112
PropertyDefinitionUtils.newPropertyBuilderBSL(6,
107113
LANG_SERVER_SUBSYSTEM_FILTER_EXCLUDE_KEY,
@@ -114,13 +120,15 @@ public static List<PropertyDefinition> getProperties() {
114120
"file.suffixes",
115121
BSL_FILE_EXTENSIONS_DEFAULT_VALUE)
116122
.multiValues(true)
123+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.PROJECT)
117124
.build(),
118125
PropertyDefinitionUtils.newPropertyBuilderExternal(0,
119126
LANG_SERVER_REPORT_PATH_KEY,
120127
"reportPaths",
121128
"")
122129
.subCategory(BSL_SUBCATEGORY)
123130
.multiValues(true)
131+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.PROJECT)
124132
.build()
125133
);
126134
}

src/main/java/com/github/_1c_syntax/bsl/sonar/ext_issues/Reporter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.github._1c_syntax.bsl.sonar.PropertyDefinitionUtils;
2525
import org.sonar.api.Plugin;
2626
import org.sonar.api.PropertyType;
27+
import org.sonar.api.config.PropertyDefinition;
2728

2829
import java.util.Arrays;
2930

@@ -116,6 +117,7 @@ default void addExtension(Plugin.Context context) {
116117
)
117118
.defaultValue(Boolean.toString(isEnableDefaultValue()))
118119
.type(PropertyType.BOOLEAN)
120+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.APP)
119121
.build(),
120122
PropertyDefinitionUtils.newPropertyBuilderReport(++index,
121123
getCreateExternalIssuesKey(),
@@ -125,6 +127,7 @@ default void addExtension(Plugin.Context context) {
125127
)
126128
.defaultValue(Boolean.toString(isCreateExternalIssuesDefaultValue()))
127129
.type(PropertyType.BOOLEAN)
130+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.APP, PropertyDefinition.ConfigScope.PROJECT)
128131
.build(),
129132
PropertyDefinitionUtils.newPropertyBuilderReport(++index,
130133
getRulesPathsKey(),
@@ -135,6 +138,7 @@ default void addExtension(Plugin.Context context) {
135138
.defaultValue("")
136139
.type(PropertyType.STRING)
137140
.multiValues(true)
141+
.onlyOnConfigScopes(PropertyDefinition.ConfigScope.APP)
138142
.build()
139143
).forEach(context::addExtension);
140144
}

0 commit comments

Comments
 (0)