-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use char-wise width instead of str
-width
#12135
Conversation
|
2e76825
to
0cd98a3
Compare
CodSpeed Performance ReportMerging #12135 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, why is this considered to be a binary file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It contains \0
character. I think I'll just inline the source code of that file as a separate test case to not do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's just the diff tab that renders it like that. The normal GitHub view is as: https://github.com/astral-sh/ruff/blob/dhruv/char-wise-width/crates/ruff_linter/resources/test/fixtures/pycodestyle/E501_4.py
70928fb
to
b49f0d6
Compare
Summary
This PR updates various references in the linter to compute the line-width for summing the width of each
char
in astr
instead of computing the width of thestr
itself.Refer to #12133 for more details.
fixes: #12130
Test Plan
Add a file with null (
\0
) character which is zero-width. Run this test case onmain
to make sure it panics and switch over to this branch to make sure it doesn't panic now.