How to break-up comments not code

Hello,

I have a very simple problem: comments. I like to write big comments that are "over the line" and have to be broken into the next line. No problem right? Just take the comment and put half of it in the next line.

Well, if I have a line like this:

other_segment.shape.cut_hole(segment.get_shape())  # note we manipulate the shape directly. This is not reversible and rather resource taxing. Try to use simplified forms

PyCharm segments it like this:

other_segment.shape.cut_hole(
segment.get_shape()) # note we manipulate the shape directly. This is not reversible and rather resource taxing. Try to use simplified forms

And not just like this:

other_segment.shape.cut_hole(segment.get_shape())  # note we manipulate the shape directly. 
# This is not reversible and rather resource taxing. Try to use simplified forms

Or:

other_segment.shape.cut_hole(segment.get_shape())  # note we manipulate the shape directly.
# This is not reversible and rather resource
# taxing. Try to use simplified forms

So where can I change that behavior?

0
1 comment

Unfortunately this behavior is not configurable. You can try a workaround - instead of invoking formatter on a whole file, press F2 to go to the inspection warning (In this case it's PEP8: Line too long), and use context action with Ctrl+Shift+Enter

This way only comments should be formatted.

0

Please sign in to leave a comment.