Repository navigation
Commit 293cacd
authored
feat(format): lay out clauses, parenthesised groups and windows as SQLQuack 0.6.0 does (#67)
* fix(deps): pin SQLQuack 0.6.0
All six direct sqlquack-* pins (11 locked packages) move from e1a583eb
(0.5.1) to 8d28aa4c (0.6.0), so SQLBuild can link one SQLQuack copy.
Work in progress: SQLQuack 0.6.0 changes the formatter's layout, and the
format expectations are not updated yet.
* feat(format): lay out clauses, parenthesised groups and windows as SQLQuack 0.6.0 does
SQLQuack 0.6.0 changes three layout rules, and SQLClean's formatter is
SQLQuack's:
- A clause with a single short item stays on its header line
(ORDER BY a DESC, GROUP BY customer_id, JOIN b ON b.id = a.id).
- A parenthesised group that spans lines gets its own lines instead of
hugging the call's parenthesis (ARRAY(\n (\n SELECT ...)).
- A window specification too wide for one line is broken into
PARTITION BY, ORDER BY and frame lines.
Parse errors now name what was expected ("Expected an expression after
BY") instead of the unexpected token.
The format corpus records the old layout as previously_formatted, and
one SQL Server departure is dropped because SQLQuack now matches
SQLClean's recorded layout.
* test(format): describe the STRUCT field-access departure's parenthesis layout1 parent be41ae2 commit 293cacd
6 files changed
Lines changed: 132 additions & 94 deletions
File tree
- crates/sqlclean/src/sql_lint/tests
- fixtures
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
0 commit comments