-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feature_request(comments): wrap comments #181
Comments
I absolutely agree with you that it would be great if Black did that. However, there is a major snag: many comments require verbatim formatting. They might have to be machine parseable, they might present code or data (especially commented out code!), and so on. There is no markup that would unambiguously state that a given comment is safe to be reformatted, so we would need to resort to heiristics. In consequence, if Black reformatted comments it would inevitably destroy information sometimes. That's a breach of trust that I'm not willing to risk. |
@ambv , what do you think about option Thanks. |
I hate options, as you probably figured out from the README. More importantly, such an option is too binary. Most of the time the answer to "Should I reformat this comment?" is: it depends. For example, a An option like you're suggesting would inevitably be insufficient and lead to requests for more configurability and intelligent heuristics. As I said in my first response, I would absolutely love to have this feature but doing it properly is sadly out of scope for a simple project like mine. I hope you don't treat my cautious pessimism here as dismissive. |
1. Summary
It would be nice, if comments would be wrapped to next lines.
2. Argumentation
Citation from Black description:
All of the above can be attributed to the comments.
3. Configuration
Example: I have a file
SashaBlack.py
:# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
4. Steps to reproduce
or
5. Expected behavior
6. Actual behavior
No changes.
Thanks.
The text was updated successfully, but these errors were encountered: