diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Clear `ruff` Configuration

Open tolgacangoz opened this issue 1 year ago • 3 comments

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 avatar Apr 18 '24 16:04 tolgacangoz

can you take a look here? @sayakpaul

yiyixuxu avatar Apr 23 '24 00:04 yiyixuxu

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.

sayakpaul avatar Apr 23 '24 01:04 sayakpaul

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

tolgacangoz avatar Apr 24 '24 06:04 tolgacangoz

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

tolgacangoz avatar May 14 '24 06:05 tolgacangoz

FYI: https://github.com/huggingface/transformers/pull/30932

tolgacangoz avatar May 29 '24 16:05 tolgacangoz