diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Apply ruff flake8-comprehensions rules.

Open Skylion007 opened this issue 3 years ago • 4 comments

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.

Skylion007 avatar Feb 19 '23 19:02 Skylion007

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?

Skylion007 avatar Feb 19 '23 20:02 Skylion007

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

pcuenca avatar Feb 20 '23 07:02 pcuenca

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.

sayakpaul avatar Feb 20 '23 07:02 sayakpaul

Looks like transformers applied this though: https://github.com/huggingface/transformers/pull/21694/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R8

pcuenca avatar Feb 28 '23 15:02 pcuenca

@Skylion007 would you mind syncing with main and reformatting?

pcuenca avatar Feb 28 '23 15:02 pcuenca

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[bot] avatar Mar 25 '23 15:03 github-actions[bot]

Superseded by #2827

pcuenca avatar Mar 27 '23 14:03 pcuenca