Skip to content

Conversation

Skylion007
Copy link
Contributor

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.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@Skylion007
Copy link
Contributor Author

It looks like the two failing checks are flakes?

@pcuenca
Copy link
Member

pcuenca commented Feb 20, 2023

Hi @Skylion007! Thanks, I've read the changes and they seem reasonable! However, when we made the change to ruff last week we made it compatible with the ruff configuration in transformers: https://github.com/huggingface/transformers/blob/main/pyproject.toml#L8. The idea is for contributors that work on both codebases to have a consistent experience. I'd invite more discussion from the rest of the team before we can apply this change /cc @patrickvonplaten @patil-suraj @williamberman @yiyixuxu @sayakpaul

select = ["E", "F", "I", "W"]
select = ["C", "E", "F", "I", "W"]
Copy link
Member

Choose a reason for hiding this comment

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

@sayakpaul
Copy link
Member

The idea is for contributors that work on both codebases to have a consistent experience.

Exactly this. If enabling this change would create a disparity between the formatting configurations of transformers and diffusers then we need to reconsider it.

@pcuenca
Copy link
Member

pcuenca commented Feb 28, 2023

@pcuenca
Copy link
Member

pcuenca commented Feb 28, 2023

@Skylion007 would you mind syncing with main and reformatting?

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale Issues that haven't received updates label Mar 25, 2023
@pcuenca pcuenca removed the stale Issues that haven't received updates label Mar 25, 2023
@pcuenca
Copy link
Member

pcuenca commented Mar 27, 2023

Superseded by #2827

@pcuenca pcuenca closed this Mar 27, 2023
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.

Enable flake8-comprehension checks for better / faster code
4 participants