Skip to content
Snippets Groups Projects
Commit e355932f authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Refactoring: use join() instead of for loop

See for reference:
https://docs.sourcery.ai/Reference/Python/Default-Rules/use-join/
parent e57fa48a
No related branches found
No related tags found
1 merge request!283Refactoring: use join() instead of for loop
Pipeline #72118 skipped with stage
......@@ -32,7 +32,6 @@ rule_settings:
- use-named-expression
- use-next
- sum-comprehension
- use-join
rule_types:
- refactoring
......
......@@ -153,9 +153,10 @@ def wait_until_merge_status_is_set(project: Project, mr: MergeRequest):
def list_commits(commits):
"""Create a list of commits along with the commit messages"""
commit_list = ""
for commit in commits:
commit_list += "\n--\n\nCommit: %s\n\n%s" % (commit.web_url, commit.message)
commit_list = "".join(
"\n--\n\nCommit: %s\n\n%s" % (commit.web_url, commit.message)
for commit in commits
)
return commit_list
......
......@@ -97,9 +97,7 @@ class MarkDownTableRow:
self._current_col += 1
def __str__(self):
c = ""
for i in self.cols:
c += "| " + i.content + " |"
c = "".join("| " + i.content + " |" for i in self.cols)
return "MarkDownTableRow (" + self.length + " cols) " + c
def render(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment