Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce ruff/flake8-comprehensions rules (C4) #4785

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Jan 1, 2025

Summary of changes

Pull Request Checklist

Copy link
Contributor

mergify bot commented Jan 1, 2025

⚠️ The sha of the head commit of this PR conflicts with #4386. Mergify cannot evaluate rules on this PR. ⚠️

1 similar comment
Copy link
Contributor

mergify bot commented Jan 5, 2025

⚠️ The sha of the head commit of this PR conflicts with #4386. Mergify cannot evaluate rules on this PR. ⚠️

FURB118 Use `operator.itemgetter(0)` instead of defining a lambda
FURB142 Use of `set.add()` in a for loop
FURB167 Use of regular expression alias `re.I`
FURB167 Use of regular expression alias `re.M`
FURB167 Use of regular expression alias `re.S`
FURB167 Use of regular expression alias `re.X`
FURB188 Prefer `removesuffix` over conditionally replacing with slice.
FURB192 Prefer `max` over `sorted()` to compute the maximum value in a sequence
C400 Unnecessary generator (rewrite as a `list` comprehension)
C401 Unnecessary generator (rewrite as a `set` comprehension)
C402 Unnecessary generator (rewrite as a `dict` comprehension)
C405 Unnecessary `list` literal (rewrite as a `set` literal)
C408 Unnecessary `dict` call (rewrite as a literal)
C413 Unnecessary `list` call around `sorted()`
C414 Unnecessary `list` call within `sorted()`
C417 Unnecessary `map` usage (rewrite using a generator expression)
C420 Unnecessary dict comprehension for iterable; use `dict.fromkeys` instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant