Skip to content

Clear ruff Configuration #7713

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

Closed
wants to merge 6 commits into from
Closed

Conversation

tolgacangoz
Copy link
Contributor

@tolgacangoz tolgacangoz commented Apr 18, 2024

Update

  1. C in the select list includes only complex-structure (C901), so it is not meaningful to select C and ignore complex-structure (C901) at the same time, thus removing both.
  2. When I remove import-shadowed-by-loop-var (F402) and undefined-local (F823) from the ignore list, make style && make quality shows nothing, also IMHO they can be useful, so they can be removed.
  3. When I remove module-import-not-at-top-of-file (E402) and redefined-while-unused (F811) from the __init__.py files' ignore list, no error except one which I proposed to resolve at my previous PR; so removed them.
  4. src/diffusers/utils/dummy_*.py files don't need to ignore unused-import (F401), so removed that line.
  5. [tool.ruff.format] section includes generic default values, so removed.

Upgrade

1. IMHO, ambiguous-variable-name (E741) might be very useful in terms of readability, why ignoring?
2. Setting line-length = 119 and ignoring line-too-long (E501) applies on all codes but length of imports. I mean that ignoring line-too-long (E501) doesn't apply to the length of imports, so line-length = 119 holds for imports. When I remove line-length = 119, because I thought it was unnecessary due to ignoring line-too-long (E501); then unsorted-imports (I001) applies for "larger" imports because the default is 88. It seems that this is still being discussed. What to do here?
3. Why don't we benefit from all the power of ruff with its latest version? It was pinned to v0.1.5, and v0.4.2 has just been announced! IMHO, there are many more fun and beneficial rules.

@sayakpaul @yiyixuxu @DN6

@tolgacangoz tolgacangoz changed the title Update Proposal for ruff Configuration Update & Upgrade Proposal for ruff Configuration Apr 19, 2024
@yiyixuxu
Copy link
Collaborator

can you take a look here? @sayakpaul

@sayakpaul
Copy link
Member

Thanks for your proposal, but we don't want to make code styling ultra-sophisticated, to be honest. So, the simplest reasonable alternative works. Our efforts are better spent in improving the library design and then maintaining the things that come with it, TBH.

@tolgacangoz
Copy link
Contributor Author

tolgacangoz commented Apr 24, 2024

OK, understood 👍. I am withdrawing the upgrade part. What about the update part, this PR?

@tolgacangoz tolgacangoz changed the title Update & Upgrade Proposal for ruff Configuration Clear ruff Configuration Apr 26, 2024
@tolgacangoz
Copy link
Contributor Author

I think this was a useless PR 🥲; thus, closing.

@tolgacangoz tolgacangoz deleted the update-ruff branch May 14, 2024 06:38
@tolgacangoz
Copy link
Contributor Author

FYI: huggingface/transformers#30932

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.

3 participants