Skip to content

Commit 9c80c24

Browse files
committed
Change conversion function name
1 parent 7b778f8 commit 9c80c24

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cli/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def convert_json(**kwargs) -> dict[str, Any]:
320320
"qualityGates": qualitygates.convert_qgs_json,
321321
"projects": pjhelp.convert_projects_json,
322322
"portfolios": foliohelp.convert_portfolios_json,
323-
"applications": applications.old_to_new_json,
323+
"applications": applications.convert_apps_json,
324324
"users": users.convert_users_json,
325325
"groups": groups.convert_groups_json,
326326
"rules": rules.convert_rules_json,

sonar/applications.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def export(self, export_settings: types.ConfigSettings) -> types.ObjectJsonRepr:
344344
"tags": self.get_tags(),
345345
}
346346
)
347-
json_data = old_to_new_json_one(json_data)
347+
json_data = convert_app_json(json_data)
348348
return util.filter_export(json_data, _IMPORTABLE_PROPERTIES, export_settings.get("FULL_EXPORT", False))
349349

350350
def set_permissions(self, data: types.JsonPermissions) -> application_permissions.ApplicationPermissions:
@@ -600,7 +600,7 @@ def search_by_name(endpoint: pf.Platform, name: str) -> dict[str, Application]:
600600
return data
601601

602602

603-
def old_to_new_json_one(old_app_json: dict[str, Any]) -> dict[str, Any]:
603+
def convert_app_json(old_app_json: dict[str, Any]) -> dict[str, Any]:
604604
"""Converts sonar-config old JSON report format to new format for a single application"""
605605
new_json = old_app_json.copy()
606606
if "permissions" in old_app_json:
@@ -610,9 +610,9 @@ def old_to_new_json_one(old_app_json: dict[str, Any]) -> dict[str, Any]:
610610
return new_json
611611

612612

613-
def old_to_new_json(old_json: dict[str, Any]) -> dict[str, Any]:
613+
def convert_apps_json(old_json: dict[str, Any]) -> dict[str, Any]:
614614
"""Converts sonar-config old JSON report format to new format"""
615615
new_json = old_json.copy()
616616
for k, v in new_json.items():
617-
new_json[k] = old_to_new_json_one(v)
617+
new_json[k] = convert_app_json(v)
618618
return util.dict_to_list(new_json, "key")

0 commit comments

Comments
 (0)