refactor + add description options

This commit is contained in:
Hussam.lawen
2023-10-24 22:28:57 +03:00
parent 07617eab5a
commit 1a89c7eadf
5 changed files with 38 additions and 24 deletions

View File

@ -304,3 +304,18 @@ def try_fix_yaml(review_text: str) -> dict:
except:
pass
return data
async def set_custom_labels(variables):
labels = get_settings().custom_labels
if not labels:
# set default labels
labels = ['Bug fix', 'Tests', 'Bug fix with tests', 'Refactoring', 'Enhancement', 'Documentation', 'Other']
labels_list = "\n - ".join(labels) if labels else ""
labels_list = f" - {labels_list}" if labels_list else ""
variables["custom_labels"] = labels_list
return
final_labels = ""
for k, v in labels.items():
final_labels += f" - {k} ({v['description']})\n"
variables["custom_labels"] = final_labels