-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
E501 false positive when using east_asian_unicode string #3902
Comments
This is a consequence of migrating from character-count to unicode-width for line-length violations (#3714), which was done in part for consistency with Black, which IIUC is moving towards splitting long lines based on width (psf/black#3445). Whether this was a correct decision for us, and in the context of line-length violations, is something worth debating, but just wanted to clarify why and how this changed (since, until recently, we did use character count). |
makes sense, thanks for explaining! |
(Separately, just realizing that it's confusing to say |
I guess I'm running into this problem when linting python files that contain comments/docstrings with Japanese characters using ruff For this line that pylint and all other tools correctly recognize to have 86 characters, ruff==0.0.267 reports it as having 122.
(please not this line has a tab at the start) |
@charliermarsh , my experience is that This is a quick test to reproduce the issue:
|
@vincent-olivert-riera - I believe you need to run with |
(I'm going to close this as a duplicate of #3825, although there's useful discussion in both issues.) |
If I have a file with:
then
ruff
reports aE501
error (whereas flake8 doesn't)Indeed, if I open the file in Python and count the length of each line, I only get 72 for the offending line:
The text was updated successfully, but these errors were encountered: