Skip to content

Commit 9aaa60d

Browse files
Fix CHECK constraint closing parenthesis alignment
- Align closing parenthesis with CHECK keyword at same indentation level - Fixes constraints-16.sql formatting where closing paren was over-indented - Maintains existing functionality for other constraint types - All constraint formatting tests pass Co-Authored-By: Dan Lynch <[email protected]>
1 parent f5834f3 commit 9aaa60d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/deparser/src/deparser.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2631,7 +2631,10 @@ export class Deparser implements DeparserVisitor {
26312631
if (this.formatter.isPretty()) {
26322632
const checkExpr = this.visit(node.raw_expr, context);
26332633
if (checkExpr.includes('\n')) {
2634-
output.push('(\n' + this.formatter.indent(checkExpr) + '\n)');
2634+
const indentedExpr = checkExpr.split('\n').map(line =>
2635+
' ' + line
2636+
).join('\n');
2637+
output.push('(\n' + indentedExpr + '\n)');
26352638
} else {
26362639
output.push(`(${checkExpr})`);
26372640
}

0 commit comments

Comments
 (0)