Skip to content

Commit

Permalink
Enable ruff rule Perflint (PERF)
Browse files Browse the repository at this point in the history
See: https://docs.astral.sh/ruff/rules/#perflint-perf

Fix the following new warnings:
lieer/gmailieer.py:866:17: PERF401 Use a list comprehension to create a transformed list
  • Loading branch information
skangas authored and gauteh committed Dec 3, 2023
1 parent 33dcb87 commit e41c966
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ target-version = "py39"
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F", "I", "UP", "C4", "SIM"]
select = ["E4", "E7", "E9", "F", "I", "UP", "C4", "SIM", "PERF"]
ignore = [
"E501", # Line too long
"E741", # Ambiguous variable name: `l`
Expand Down
3 changes: 1 addition & 2 deletions lieer/gmailieer.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,7 @@ def full_pull(self):
self.bar.total = total
self.bar_update(len(gids))

for m in gids:
message_gids.append(m["id"])
message_gids = [m["id"] for m in gids]

if self.limit is not None and len(message_gids) >= self.limit:
break
Expand Down

0 comments on commit e41c966

Please sign in to comment.