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

STY: activate flake8-comprehensions (ruff) #4444

Merged
merged 4 commits into from
May 17, 2023

Conversation

neutrinoceros
Copy link
Member

PR Summary

Follow up to #4320

Following https://gist.github.com/aureliojargas/70bd3667afd18f2a4f4e23d7ae5a2915:

Comprehension-related autofixes are not included in ruff's UP (pyupgrade) rule set because they are redundant with a subset of flake8-comprehensions. Here I'm choosing to activate the whole set of rules from this plugin for simplicity of configuration.

@neutrinoceros neutrinoceros added code style Related to linting tools infrastructure Related to CI, versioning, websites, organizational issues, etc labels May 14, 2023
@neutrinoceros
Copy link
Member Author

pre-commit.ci autofix

1 similar comment
@neutrinoceros
Copy link
Member Author

pre-commit.ci autofix

@neutrinoceros neutrinoceros changed the title STY: activate flake8-comprenhensions (ruff) STY: activate flake8-comprehensions (ruff) May 14, 2023
@neutrinoceros
Copy link
Member Author

The diff ends up much bigger than I expected but it seems sound nonetheless

@neutrinoceros neutrinoceros marked this pull request as ready for review May 14, 2023 11:17
Copy link
Member

@cphyc cphyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming we indeed want this, that looks good to me :)

@matthewturk
Copy link
Member

Same

@neutrinoceros
Copy link
Member Author

Thanks guys. I'm going to triage this into the 4.2 milestone because merging it before the release rather than after would avoid making backports more conflict-prone. If anyone wants to object I can also reduce the scope of this PR and reduce the diff to rules that pyupgrade used to enforce.

@neutrinoceros neutrinoceros added this to the 4.2.0 milestone May 15, 2023
@jzuhone jzuhone closed this May 15, 2023
@jzuhone jzuhone reopened this May 15, 2023
@jzuhone
Copy link
Contributor

jzuhone commented May 15, 2023

Sorry, I accidentally hit the close button

@neutrinoceros
Copy link
Member Author

This doesn't seem to be controversial with 3 explicit approvals, but just in case, I'll leave it open for another day, and aim at merging tomorrow

@neutrinoceros neutrinoceros merged commit e6ee162 into yt-project:main May 17, 2023
@neutrinoceros neutrinoceros deleted the flake8-comp branch May 17, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code style Related to linting tools infrastructure Related to CI, versioning, websites, organizational issues, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants