Rewrap icon indicating copy to clipboard operation
Rewrap copied to clipboard

Rewrap on or off in sections of code

Open krish7919 opened this issue 4 years ago • 0 comments

I have a Python file with long SQL queries like so:

<python code>
query = """
    SELECT x, y, z
    FROM table
    WHERE y = a
"""
<python code>

I run rewrap on the file by selected all the text and wrapping (Ctrl + a, Alt + q).

However this rewraps my SQL code like so:

<python code>
query = """
    SELECT x, y, z FROM
    table WHERE y = a
"""
<python code>

The black formatter has a # fmt: off ... # fmt: on block which ensures that it does not format the sections of code between these directives. Is there anything for rewrap to turn it off and on in sections of a file?

krish7919 avatar Oct 13 '21 21:10 krish7919