-
Notifications
You must be signed in to change notification settings - Fork 924
Line exceeded maximum length warning caused by CRLF #1335
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
Comments
@iliekturtles It indeed does : https://github.com/rust-lang-nursery/rustfmt/blob/master/src/lib.rs#L473 However, since there's a special case for |
After digging through the blame I see that commit 598fcdd, which references #717, added the |
@iliekturtles Good catch ! It actually does handle them quite poorly. This code (length of the line is 70 grapheme-long):
produces :
Let's open an issue for that and link it to this one ? |
The special case code for Rustfmt just doesn't handle unicode > 8 bits well at all (currently the oldest issue in this repo - #6). |
Thanks for the info @nrc . I'll crate a PR accordingly to your suggestion |
Resolves rust-lang#1335. Does not attempt to handle a \r not followed by a \n nor attempt to handle Unicode intracacies including zero-width or multi-byte characters.
Resolves rust-lang#1335. Does not attempt to handle a `\r` not followed by a `\n` nor attempt to handle Unicode intricacies including zero-width or multi-byte characters.
Resolves rust-lang#1335. Does not attempt to handle a `\r` not followed by a `\n` nor attempt to handle Unicode intricacies (rust-lang#6) including zero-width or multi-byte characters.
The code block below gives the following warning when the file is saved with Window's native CRLF line ending:
Rustfmt failed at S:\uom\src\system.rs:143: line exceeded maximum length (maximum: 100, found: 101) (sorry)
. Saving the file with a LF line ending silences the warning.rustfmt
must be counting the CR (\r
) as part of the line length.The text was updated successfully, but these errors were encountered: