-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Enforce ruff/flake8-comprehensions rules (C4) #4785
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
base: main
Are you sure you want to change the base?
Conversation
|
1 similar comment
|
bf51fe7
to
1ea7c2c
Compare
I think you'll want to enable allow-dict-calls-with-keyword-arguments |
bb995d6
to
5e77363
Compare
After adding allow-dict-calls-with-keyword-arguments, most occurrences of C408 have disappeared. A few instances of |
I personally think those make sense, it's mainly changing generators of tuples into dict comprehensions. |
ef18ee2
to
e525809
Compare
412819f
to
36fa684
Compare
Rebased. |
|
I'm not sure your rebase is correct. I see refurb related changes and the change PyPy tests have also been flaky: #4940 |
I had to rerun |
Reapplied |
C400 Unnecessary generator (rewrite as a `list` comprehension)
C401 Unnecessary generator (rewrite as a `set` comprehension)
C402 Unnecessary generator (rewrite as a `dict` comprehension)
C408 Unnecessary `dict()` call (rewrite as a literal) C405 Unnecessary `list` literal (rewrite as a `set` literal)
ff4292e
to
051b475
Compare
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
Summary of changes
Pull Request Checklist
newsfragments/
.(See documentation for details)