You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that this behavior is different than Flake8 and Black as they treat one Chinese character as one.
I use Ruff (v2023.20.0) the VSCode version with all the default settings.
Other considerations
I know that Chinese characters take more space than ASCII characters and the actual ratio depends on fonts and rendering.
On Windows 11 VSCode,
Dejavu Sans Mono: 53 Chinese characters take 88 ASCII characters' space
Cascadia Mono: 52 Chinese characters take 88 ASCII characters' space
As we can see, the radio is not 2.
Also, this behaviour makes Ruff not compatible with the Black formatter because more often than not, the Black does not break lines while Ruff keeps reporting the E501 warning.
The text was updated successfully, but these errors were encountered:
There's a bit more info on this in #3902 and #3825. Ruff is using character width (which is defined as part of the Unicode standard, I think, although I'm not an expert), rather than character count. Black made the same change, but it's still in preview (you should see the same behavior if you run with black --preview). We may consider changing this, though I'm going to close this as a duplicate of the others for now.
I have noticed that Ruff treats every Chinese character as two, so it often falsely reports the "Line too long (E501)" warning.
I believe that this behavior is different than Flake8 and Black as they treat one Chinese character as one.
I use Ruff (v2023.20.0) the VSCode version with all the default settings.
Other considerations
I know that Chinese characters take more space than ASCII characters and the actual ratio depends on fonts and rendering.
On Windows 11 VSCode,
As we can see, the radio is not 2.
Also, this behaviour makes Ruff not compatible with the Black formatter because more often than not, the Black does not break lines while Ruff keeps reporting the E501 warning.
The text was updated successfully, but these errors were encountered: