Skip to content

Commit bc579c9

Browse files
committed
Remove list inlining
1 parent db67ab3 commit bc579c9

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

cli/config.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545

4646
TOOL_NAME = "sonar-config"
4747

48-
DONT_INLINE_LISTS = "dontInlineLists"
4948
FULL_EXPORT = "fullExport"
5049
EXPORT_EMPTY = "exportEmpty"
5150

@@ -110,14 +109,6 @@ def __parse_args(desc: str) -> object:
110109
f"By default the export will show the value as '{utilities.DEFAULT}' "
111110
"and the setting will not be imported at import time",
112111
)
113-
parser.add_argument(
114-
f"--{DONT_INLINE_LISTS}",
115-
required=False,
116-
default=False,
117-
action="store_true",
118-
help="By default, sonar-config exports multi-valued settings as comma separated strings instead of arrays (if there is not comma in values). "
119-
"Set this flag if you want to force export multi valued settings as arrays",
120-
)
121112
parser.add_argument(
122113
f"--{EXPORT_EMPTY}",
123114
required=False,
@@ -192,10 +183,12 @@ def write_objects(queue: Queue[types.ObjectJsonRepr], fd: TextIO, object_type: s
192183
while not done:
193184
obj_json = queue.get()
194185
if not (done := obj_json is utilities.WRITE_END):
186+
log.info("WRITING %s", utilities.json_dump(obj_json))
195187
if object_type == "groups":
196188
obj_json = __prep_json_for_write(obj_json, {**export_settings, EXPORT_EMPTY: True})
197189
else:
198190
obj_json = __prep_json_for_write(obj_json, export_settings)
191+
log.info("CONVERTED WRITING %s", utilities.json_dump(obj_json))
199192
key = "" if isinstance(obj_json, list) else obj_json.get("key", obj_json.get("login", obj_json.get("name", "unknown")))
200193
log.debug("Writing %s key '%s'", object_type[:-1], key)
201194
if object_type in objects_exported_as_lists or object_type in objects_exported_as_whole:
@@ -216,7 +209,6 @@ def export_config(endpoint: platform.Platform, what: list[str], **kwargs) -> Non
216209
export_settings = kwargs.copy()
217210
export_settings.update(
218211
{
219-
"INLINE_LISTS": not kwargs.get(DONT_INLINE_LISTS, False),
220212
"EXPORT_DEFAULTS": True,
221213
"FULL_EXPORT": kwargs.get(FULL_EXPORT, False),
222214
"MODE": mode,
@@ -274,8 +266,6 @@ def __prep_json_for_write(json_data: types.ObjectJsonRepr, export_settings: type
274266
if not export_settings.get(EXPORT_EMPTY, False):
275267
log.debug("Removing empties")
276268
json_data = utilities.clean_data(json_data, remove_empty=True)
277-
if export_settings.get("INLINE_LISTS", True):
278-
json_data = utilities.inline_lists(json_data, exceptions=("conditions",))
279269
return json_data
280270

281271

0 commit comments

Comments
 (0)