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: ...@@ -32,7 +32,6 @@ rule_settings:
- use-named-expression - use-named-expression
- use-next - use-next
- sum-comprehension - sum-comprehension
- use-join
rule_types: rule_types:
- refactoring - refactoring
......
...@@ -153,9 +153,10 @@ def wait_until_merge_status_is_set(project: Project, mr: MergeRequest): ...@@ -153,9 +153,10 @@ def wait_until_merge_status_is_set(project: Project, mr: MergeRequest):
def list_commits(commits): def list_commits(commits):
"""Create a list of commits along with the commit messages""" """Create a list of commits along with the commit messages"""
commit_list = "" commit_list = "".join(
for commit in commits: "\n--\n\nCommit: %s\n\n%s" % (commit.web_url, commit.message)
commit_list += "\n--\n\nCommit: %s\n\n%s" % (commit.web_url, commit.message) for commit in commits
)
return commit_list return commit_list
......
...@@ -97,9 +97,7 @@ class MarkDownTableRow: ...@@ -97,9 +97,7 @@ class MarkDownTableRow:
self._current_col += 1 self._current_col += 1
def __str__(self): def __str__(self):
c = "" c = "".join("| " + i.content + " |" for i in self.cols)
for i in self.cols:
c += "| " + i.content + " |"
return "MarkDownTableRow (" + self.length + " cols) " + c return "MarkDownTableRow (" + self.length + " cols) " + c
def render(self): 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