-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Apply ruff flake8-comprehensions rules. #2425
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
Apply ruff flake8-comprehensions rules. #2425
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
It looks like the two failing checks are flakes? |
Hi @Skylion007! Thanks, I've read the changes and they seem reasonable! However, when we made the change to |
select = ["E", "F", "I", "W"] | ||
select = ["C", "E", "F", "I", "W"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly this. If enabling this change would create a disparity between the formatting configurations of |
Looks like transformers applied this though: https://github.com/huggingface/transformers/pull/21694/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R8 |
@Skylion007 would you mind syncing with |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Superseded by #2827 |
Fix #2424
Enables flake8-comprehension checks in ruff and adds the automatically generated fixes. This should strictly improve performance by removing unnecessary lookups, iterations, and function calls. It should also help readability and generate more efficient Python byte code.