From 3421ac0356bbeeb7309cc180bfa7b7a0fcf52dac Mon Sep 17 00:00:00 2001 From: pnadolny13 Date: Wed, 26 Jul 2023 22:55:10 -0400 Subject: [PATCH] black formatting --- hub_utils/meltano_util.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/hub_utils/meltano_util.py b/hub_utils/meltano_util.py index 49541be..584657c 100644 --- a/hub_utils/meltano_util.py +++ b/hub_utils/meltano_util.py @@ -227,7 +227,10 @@ def _dedup_settings(reformatted_settings): if name in reformatted_settings_2: existing_setting = reformatted_settings_2.get(name) existing_setting["description"] = ", ".join( - [existing_setting["description"], MeltanoUtil._clean_description(setting.get("description"))] + [ + existing_setting["description"], + MeltanoUtil._clean_description(setting.get("description")), + ] ) else: reformatted_settings_2[name] = setting @@ -275,7 +278,7 @@ def _parse_sdk_about_settings(sdk_about_dict, enforce_desc=False): description = MeltanoUtil._handle_description( MeltanoUtil._clean_description(settings.get("description")), name, - enforce_desc + enforce_desc, ) setting_details = { "name": name, @@ -317,7 +320,9 @@ def _traverse_schema_properties(schema, field_sep="."): reqs = value.get("required", []) field = { "name": full_name, - "description": MeltanoUtil._clean_description(subfield.get("description")), + "description": MeltanoUtil._clean_description( + subfield.get("description") + ), "default": subfield.get("default"), "type": subfield.get("type"), "title": subfield.get("title"), @@ -336,7 +341,9 @@ def _traverse_schema_properties(schema, field_sep="."): fields.append( { "name": key, - "description": MeltanoUtil._clean_description(value.get("description")), + "description": MeltanoUtil._clean_description( + value.get("description") + ), "default": value.get("default"), "type": value.get("type"), "title": value.get("title"), @@ -378,7 +385,9 @@ def _split_sentence_endings(word_list): desc_list_clean = [] for word in word_list: if len(word.split(".")) > 1: - if not any(keyword in word for keyword in ("http", "ssh", "ssl", "e.g.")): + if not any( + keyword in word for keyword in ("http", "ssh", "ssl", "e.g.") + ): desc_list_clean.extend(word.replace(".", ". ").split()) continue desc_list_clean.append(word) @@ -398,12 +407,17 @@ def _capitalize(cleaned_sentence): for elem in capital_list: sentence_list = elem.split() last_elem = MeltanoUtil._last_element(clean_capital_list) - if sentence_list[0][0].isupper() or sentence_list[0][0] == "'" or last_elem.endswith('e.g') or last_elem.endswith('i.e'): + if ( + sentence_list[0][0].isupper() + or sentence_list[0][0] == "'" + or last_elem.endswith("e.g") + or last_elem.endswith("i.e") + ): clean_capital_list.append(" ".join(sentence_list)) else: sentence_list[0] = sentence_list[0].capitalize() clean_capital_list.append(" ".join(sentence_list)) - + return ". ".join(clean_capital_list) @staticmethod