Skip to content

Commit a169194

Browse files
committed
Fix default "MODE"
1 parent aa3a7b1 commit a169194

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

sonar/branches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def export(self, export_settings: types.ConfigSettings) -> types.ObjectJsonRepr:
230230
data[settings.NEW_CODE_PERIOD] = self.new_code()
231231
if export_settings.get("FULL_EXPORT", True):
232232
data.update({"name": self.name, "project": self.concerned_object.key})
233-
if export_settings["MODE"] == "MIGRATION":
233+
if export_settings.get("MODE", "") == "MIGRATION":
234234
data["lastAnalysis"] = util.date_to_string(self.last_analysis())
235235
lang_distrib = self.get_measure("ncloc_language_distribution")
236236
loc_distrib = {}

sonar/projects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ def export(self, export_settings: types.ConfigSettings, settings_list: dict[str,
974974
json_data["webhooks"] = hooks
975975
json_data = util.filter_export(json_data, _IMPORTABLE_PROPERTIES, export_settings.get("FULL_EXPORT", False))
976976

977-
if export_settings["MODE"] == "MIGRATION":
977+
if export_settings.get("MODE", "") == "MIGRATION":
978978
json_data["lastAnalysis"] = util.date_to_string(self.last_analysis())
979979
json_data["detectedCi"] = self.ci()
980980
json_data["revision"] = self.revision()

sonar/rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def export(endpoint: platform.Platform, export_settings: types.ConfigSettings, k
297297
rule_list["extended"] = extended_rules
298298
if len(other_rules) > 0 and full:
299299
rule_list["standard"] = other_rules
300-
if export_settings["MODE"] == "MIGRATION":
300+
if export_settings.get("MODE", "") == "MIGRATION":
301301
rule_list["thirdParty"] = {r.key: r.export() for r in third_party(endpoint=endpoint)}
302302
return rule_list
303303

0 commit comments

Comments
 (0)