-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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) #9724
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max-sixty
reviewed
Nov 6, 2024
DimitriPapadopoulos
force-pushed
the
C4
branch
2 times, most recently
from
November 7, 2024 11:55
b7dcb26
to
fa3fd6e
Compare
C409 Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`) C409 Unnecessary list comprehension passed to `tuple()` (rewrite as a generator)
C414 Unnecessary `tuple` call within `sorted()`
C416 Unnecessary `dict` comprehension (rewrite using `dict()`) C416 Unnecessary `list` comprehension (rewrite using `list()`)
C417 Unnecessary `map` usage (rewrite using a generator expression)
C419 Unnecessary list comprehension
DimitriPapadopoulos
force-pushed
the
C4
branch
from
November 7, 2024 16:18
fa3fd6e
to
485e4a0
Compare
max-sixty
approved these changes
Nov 7, 2024
dcherian
added a commit
to dcherian/xarray
that referenced
this pull request
Nov 7, 2024
* main: Enforce ruff/flake8-pie rules (PIE) (pydata#9740) Enforce ruff/flake8-comprehensions rules (C4) (pydata#9724) Enforce ruff/Perflint rules (PERF) (pydata#9730) Apply ruff rule RUF007 (pydata#9739) chmod -x (pydata#9725) Aplpy ruff rules (RUF) (pydata#9731) Fix typos found by codespell (pydata#9721) support for additional scipy nd interpolants (pydata#9599) Apply ruff/flake8-simplify rules (SIM) (pydata#9727) Apply ruff/flake8-implicit-str-concat rules (ISC) (pydata#9722) Apply ruff/flake8-pie rules (PIE) (pydata#9726) Enforce ruff/pygrep-hooks rules (PGH) (pydata#9729) Move to micromamba 2 (pydata#9732) Fix groupby tests (pydata#9716) Add missing xarray.core.missing import (pydata#9714) Fix writing of DataTree subgroups to zarr or netCDF (pydata#9677) Bump pypa/gh-action-pypi-publish from 1.10.3 to 1.11.0 in the actions group (pydata#9707) Update pre-commit hooks (pydata#9713)
dcherian
added a commit
to scharlottej13/xarray
that referenced
this pull request
Nov 9, 2024
* main: (125 commits) http:// → https:// (pydata#9748) Discard useless `!s` conversion in f-string (pydata#9752) Apply ruff/flake8-simplify rule SIM401 (pydata#9749) Use micromamba 1.5.10 where conda is needed (pydata#9737) pin array-api-strict<=2.1 (pydata#9751) Reorganise ruff rules (pydata#9738) use new conda-forge package pydap-server (pydata#9741) Enforce ruff/flake8-pie rules (PIE) (pydata#9740) Enforce ruff/flake8-comprehensions rules (C4) (pydata#9724) Enforce ruff/Perflint rules (PERF) (pydata#9730) Apply ruff rule RUF007 (pydata#9739) chmod -x (pydata#9725) Aplpy ruff rules (RUF) (pydata#9731) Fix typos found by codespell (pydata#9721) support for additional scipy nd interpolants (pydata#9599) Apply ruff/flake8-simplify rules (SIM) (pydata#9727) Apply ruff/flake8-implicit-str-concat rules (ISC) (pydata#9722) Apply ruff/flake8-pie rules (PIE) (pydata#9726) Enforce ruff/pygrep-hooks rules (PGH) (pydata#9729) Move to micromamba 2 (pydata#9732) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have not enforced:
list
comprehension)set
comprehension)list
comprehension (rewrite as aset
comprehension)list
literal (rewrite as aset
literal)dict
call (rewrite as a literal)The reason is that maintainers are often less fond of these rules. I am happy to apply them if there's interest.