Skip to content

Commit 54aa8cb

Browse files
authored
⬆️ QD-11230 Fix merging of configuration, update error messages (#678)
1 parent f2936e8 commit 54aa8cb

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

platform/effectiveconfig/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,18 +275,18 @@ func verifyEffectiveQodanaYamlIdeAndLinterMatchLocal(
275275
failedToCreateEffectiveConfigurationMessage := "Failed to create effective configuration"
276276

277277
topMessageTemplate := "'%s: %s' is specified in one of files provided by 'imports' from " + localQodanaYamlPathFromRoot + " '%s' is required in root qodana.yaml"
278-
bottomMessageTemplate := "Add `ide: %s` to " + localQodanaYamlPathFromRoot
278+
bottomMessageTemplate := "Add `%s: %s` to " + localQodanaYamlPathFromRoot
279279
if effectiveIde != localQodanaYaml.Ide {
280280
msg.ErrorMessage(failedToCreateEffectiveConfigurationMessage)
281281
msg.ErrorMessage(topMessageTemplate, "ide", effectiveIde, "ide")
282-
msg.ErrorMessage(bottomMessageTemplate, effectiveIde)
282+
msg.ErrorMessage(bottomMessageTemplate, "ide", effectiveIde)
283283
return errors.New("effective.qodana.yaml `ide` doesn't match root qodana.yaml `ide`")
284284
}
285285
//goland:noinspection GoDfaConstantCondition
286286
if effectiveLinter != localQodanaYaml.Linter {
287287
msg.ErrorMessage(failedToCreateEffectiveConfigurationMessage)
288288
msg.ErrorMessage(topMessageTemplate, "linter", effectiveLinter, "linter")
289-
msg.ErrorMessage(bottomMessageTemplate, effectiveLinter)
289+
msg.ErrorMessage(bottomMessageTemplate, "linter", effectiveLinter)
290290
return errors.New("effective.qodana.yaml `linter` doesn't match root qodana.yaml `linter`")
291291
}
292292
}

platform/effectiveconfig/testdata/ide and linter defined in root and child qodana yaml/expected/effective.qodana.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ ide: QDJVM
55
linter: 'jetbrains/qodana-jvm:latest'
66

77
include:
8-
# from root
9-
- name: InspectionA
10-
- name: InspectionB #from root
118
# from inner
129
- name: InspectionC # from inner
1310
- name: InspectionD
11+
# from root
12+
- name: InspectionA
13+
- name: InspectionB #from root
1414

1515
#this is a failure conditions section
1616
failureConditions:

platform/effectiveconfig/testdata/local and global input qodana yaml/expected/effective.qodana.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ profile:
44
path: b-profile.yaml
55

66
include:
7-
# from local
8-
- name: InspectionA
9-
- name: InspectionB #from local
107
# from global
118
- name: InspectionC # from global
129
- name: InspectionD
10+
# from local
11+
- name: InspectionA
12+
- name: InspectionB #from local
1313

1414
#this is a failure conditions section
1515
failureConditions:

platform/effectiveconfig/testdata/local and global input qodana yaml/expected/qodana-config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"L_OVER_G",
2222
"LG",
2323
"LG",
24-
"L",
25-
"L",
26-
"L",
2724
"G",
2825
"G",
2926
"G",
27+
"L",
28+
"L",
29+
"L",
3030
"LG",
3131
"LG",
3232
"LG",
@@ -37,6 +37,6 @@
3737
"G"
3838
]
3939
},
40-
"content": "version: 1.0\n\nprofile:\n path: b-profile.yaml\n\ninclude:\n # from local\n - name: InspectionA\n - name: InspectionB #from local\n # from global\n - name: InspectionC # from global\n - name: InspectionD\n\n#this is a failure conditions section\nfailureConditions:\n # this is a severityThresholds section\n severityThresholds:\n any: 1 #from local\n critical: 2 # from local\n moderate: 3 # moderate is global"
40+
"content": "version: 1.0\n\nprofile:\n path: b-profile.yaml\n\ninclude:\n # from global\n - name: InspectionC # from global\n - name: InspectionD\n # from local\n - name: InspectionA\n - name: InspectionB #from local\n\n#this is a failure conditions section\nfailureConditions:\n # this is a severityThresholds section\n severityThresholds:\n any: 1 #from local\n critical: 2 # from local\n moderate: 3 # moderate is global"
4141
}
4242
}

platform/effectiveconfig/testdata/only local input qodana yaml/expected/a-profile.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ name: qodana.recommended
22
baseProfile: Project Default
33

44
groups:
5+
- groupId: NonReSharperInspections
6+
groups:
7+
- ALL
8+
- '!ReSharperInspections'
9+
- '!QodanaDotNetInspections'
10+
11+
- groupId: LowSeverity
12+
groups:
13+
- 'severity:WEAK WARNING'
14+
- 'severity:HINT'
15+
- 'severity:TYPO'
516
- groupId: ReSharperInspections # ReSharper inspections are enabled by default
617
groups:
718
- 'category:C++'
@@ -110,19 +121,12 @@ groups:
110121
- RiderStaticSanityInspections # Inspections that appear in sanity profile
111122
- 'severity:INFORMATION' # Qodana doesn't run "invisible" and "technical" in IDE inspections
112123
- 'severity:TEXT ATTRIBUTES' # Qodana don't run "invisible" and "technical" in IDE inspections
113-
- groupId: NonReSharperInspections
114-
groups:
115-
- ALL
116-
- '!ReSharperInspections'
117-
- '!QodanaDotNetInspections'
118-
119-
- groupId: LowSeverity
120-
groups:
121-
- 'severity:WEAK WARNING'
122-
- 'severity:HINT'
123-
- 'severity:TYPO'
124124

125125
inspections:
126+
- group: LowSeverity # CLT doesn't provide them by default
127+
enabled: false
128+
- group: NonReSharperInspections
129+
enabled: false
126130
- group: DotnetExcluded
127131
enabled: false
128132
- group: QodanaDotNetInspections # Explicitly enable coverage and dependency vulnerability analysis by default
@@ -134,8 +138,4 @@ inspections:
134138
- '.qodana/**'
135139
- '**/*.DotSettings' # Ignore .DotSettings files by default
136140
- 'scope#$gitignore' # $gitignore scope available only in qodana execution
137-
- 'scope#$UnrealEngine' # Ignore Unreal Engine files by default
138-
- group: LowSeverity # CLT doesn't provide them by default
139-
enabled: false
140-
- group: NonReSharperInspections
141-
enabled: false
141+
- 'scope#$UnrealEngine' # Ignore Unreal Engine files by default

platform/effectiveconfig/testdata/only local input qodana yaml/expected/effective.qodana.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ profile:
44
path: a-profile.yaml
55

66
include:
7-
# from root
8-
- name: InspectionA
9-
- name: InspectionB #from root
107
# from inner
118
- name: InspectionC # from inner
129
- name: InspectionD
10+
# from root
11+
- name: InspectionA
12+
- name: InspectionB #from root
1313

1414
#this is a failure conditions section
1515
failureConditions:

tooling/resources.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"config-loader-cli.jar": {
33
"url": "https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/org/jetbrains/qodana/config-loader-cli/$version/config-loader-cli-$version.jar",
4-
"version": "0.0.31",
5-
"sha256": "38a58de7c76f08c172fd21d299ef9a122637caa48b9c1444997387bbfebc6d84"
4+
"version": "0.0.34",
5+
"sha256": "1e58d22658ba6c8d33234dc73a146418d770e5a8d23bf44bdb8f94667bf756d8"
66
},
77
"publisher-cli.jar": {
88
"url": "https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/org/jetbrains/qodana/publisher-cli/$version/publisher-cli-$version.jar",

0 commit comments

Comments
 (0)