-
Notifications
You must be signed in to change notification settings - Fork 922
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
Rustfmt fails in rustfmt_skip-blocks with line exceeded maximum length #1298
Comments
This is expected behaviour - the logic is that even where Rustfmt does not format, the user is still interested to know if their formatting satisfies the constraints they have given Rustfmt. We should probably have a command line flag or config option to change this bahaviour. |
Ok, your argument makes sense. A config option or command line flag for changing this behavior would probably be nice, but I can live with the current behavior. And by the way: Thanks for creating such an awesome tool. I really enjoy using it. 👍 |
Maybe an additional attribute would be the best solution, something like: This would give the developer finer grained control over which parts should be checked, whether they satisfy the constraints. |
I would vote for an additional attribute giving finer control. I can easily imagine a scenario in which you have a painstakingly handcrafted source layout that you want to maintain manually in which case you would want to be informed about style violations. However, right now I'm getting bogus warnings for raw string literals (in my case big regular expressions) that just force the too long lines on me. When you really cannot split the line the warnings are unhelpful and worsens the signal-to-noise ratio. |
If I try to format the following code:
Rustfmt fails with the following error:
Rustfmt failed at stdin:3: line exceeded maximum length (maximum: 100, found: 108) (sorry)
I would expect, that rustfmt doesn't complain about lines, which it shouldn't format in the first place.
The text was updated successfully, but these errors were encountered: