sqlnbfmt 0.1.6__tar.gz → 0.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqlnbfmt-0.1.6/sqlnbfmt.egg-info → sqlnbfmt-0.1.7}/PKG-INFO +1 -1
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/pyproject.toml +1 -1
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/sqlnbfmt/formatter.py +13 -6
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7/sqlnbfmt.egg-info}/PKG-INFO +1 -1
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/LICENSE +0 -0
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/README.md +0 -0
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/setup.cfg +0 -0
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/sqlnbfmt/__init__.py +0 -0
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/sqlnbfmt.egg-info/SOURCES.txt +0 -0
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/sqlnbfmt.egg-info/dependency_links.txt +0 -0
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/sqlnbfmt.egg-info/entry_points.txt +0 -0
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/sqlnbfmt.egg-info/requires.txt +0 -0
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/sqlnbfmt.egg-info/top_level.txt +0 -0
- {sqlnbfmt-0.1.6 → sqlnbfmt-0.1.7}/tests/test_formatter.py +0 -0
|
@@ -254,7 +254,7 @@ class SQLStringFormatter(ast.NodeTransformer):
|
|
|
254
254
|
formatted_sql = '\n'.join(indented_lines)
|
|
255
255
|
|
|
256
256
|
# Reconstruct the string with appropriate quotes
|
|
257
|
-
formatted_str = f'"""\n{formatted_sql}\n"""'
|
|
257
|
+
formatted_str = f'"""\n{formatted_sql}\n{" " * 4}"""'
|
|
258
258
|
else:
|
|
259
259
|
# Ensure newlines are added around the formatted SQL
|
|
260
260
|
formatted_str = f'"""\n{formatted_sql}\n"""'
|
|
@@ -328,11 +328,18 @@ class SQLStringFormatter(ast.NodeTransformer):
|
|
|
328
328
|
|
|
329
329
|
new_node = ast.JoinedStr(values=new_values)
|
|
330
330
|
if '\n' in formatted_sql:
|
|
331
|
-
|
|
332
|
-
ast.
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
331
|
+
if in_function:
|
|
332
|
+
formatted_fstring = ast.JoinedStr(values=[
|
|
333
|
+
ast.Constant(value='\n'),
|
|
334
|
+
*new_node.values,
|
|
335
|
+
ast.Constant(value=f'\n{" " * 4}')
|
|
336
|
+
])
|
|
337
|
+
else:
|
|
338
|
+
formatted_fstring = ast.JoinedStr(values=[
|
|
339
|
+
ast.Constant(value='\n'),
|
|
340
|
+
*new_node.values,
|
|
341
|
+
ast.Constant(value='\n')
|
|
342
|
+
])
|
|
336
343
|
else:
|
|
337
344
|
formatted_fstring = new_node
|
|
338
345
|
return formatted_fstring
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|