mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 07:10:42 -08:00
Clean Code: Apply flake8-simplify to Python
Also flake8-comprehensions which was added to the CI For flake8-simplify, there are a few false-positives, e.g. https://github.com/MartinThoma/flake8-simplify/issues/115
This commit is contained in:
@@ -18,9 +18,7 @@ class Canvas:
|
||||
|
||||
def render(self):
|
||||
lines = [" 1 2 3 4 5 6 7 8 9"]
|
||||
row = 0
|
||||
for line in self._buffer:
|
||||
row += 1
|
||||
for row, line in enumerate(self._buffer, start=1):
|
||||
lines.append(" " + str(row) + " " * 5 + " ".join(line))
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user