Rewrap
Rewrap copied to clipboard
Rewrap on or off in sections of code
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?