pr_types rstrip

This commit is contained in:
mrT23
2024-07-07 08:08:53 +03:00
parent 4246792261
commit 5b594dadee
2 changed files with 3 additions and 1 deletions

View File

@ -367,6 +367,7 @@ class PRDescription:
pr_types = self.data['type'] pr_types = self.data['type']
elif type(self.data['type']) == str: elif type(self.data['type']) == str:
pr_types = self.data['type'].split(',') pr_types = self.data['type'].split(',')
pr_types = [label.strip() for label in pr_types]
# convert lowercase labels to original case # convert lowercase labels to original case
try: try:
@ -470,7 +471,7 @@ class PRDescription:
else: else:
# if the value is a list, join its items by comma # if the value is a list, join its items by comma
if isinstance(value, list): if isinstance(value, list):
value = ', '.join(v for v in value) value = ', '.join(v.rstrip() for v in value)
pr_body += f"{value}\n" pr_body += f"{value}\n"
if idx < len(self.data) - 1: if idx < len(self.data) - 1:
pr_body += "\n\n___\n\n" pr_body += "\n\n___\n\n"

View File

@ -164,6 +164,7 @@ class PRGenerateLabels:
pr_types = self.data['labels'] pr_types = self.data['labels']
elif type(self.data['labels']) == str: elif type(self.data['labels']) == str:
pr_types = self.data['labels'].split(',') pr_types = self.data['labels'].split(',')
pr_types = [label.strip() for label in pr_types]
# convert lowercase labels to original case # convert lowercase labels to original case
try: try: