Skip to content

Commit 3e28614

Browse files
authored
Merge PR #265: Deprecate problematic config-options
2 parents b72f9bd + a9cdfc1 commit 3e28614

File tree

4 files changed

+51
-14
lines changed

4 files changed

+51
-14
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ All fields are optional and all fields that are not specified will be filled wit
149149
- [**`useTabs`**](docs/useTabs.md) to use tabs for indentation.
150150
- [**`keywordCase`**](docs/keywordCase.md) uppercases or lowercases keywords.
151151
- [**`indentStyle`**](docs/indentStyle.md) defines overall indentation style.
152-
- [**`multilineLists`**](docs/multilineLists.md) determines when to break lists of items to multiple lines.
152+
- [**`multilineLists`**](docs/multilineLists.md) **(DEPRECATED)** determines when to break lists of items to multiple lines.
153153
- [**`logicalOperatorNewline`**](docs/logicalOperatorNewline.md) newline before or after boolean operator (AND, OR, XOR).
154154
- [**`aliasAs`**](docs/aliasAs.md) enforces or forbids use of AS keyword for aliases.
155155
- [**`tabulateAlias`**](docs/tabulateAlias.md) aligns column aliases vertically.
156156
- [**`commaPosition`**](docs/commaPosition.md) where to place the comma in column lists.
157-
- [**`newlineBeforeOpenParen`**](docs/newlineBeforeOpenParen.md) placement of opening parenthesis.
158-
- [**`newlineBeforeCloseParen`**](docs/newlineBeforeCloseParen.md) placement of closing parenthesis.
157+
- [**`newlineBeforeOpenParen`**](docs/newlineBeforeOpenParen.md) **(DEPRECATED)** placement of opening parenthesis.
158+
- [**`newlineBeforeCloseParen`**](docs/newlineBeforeCloseParen.md) **(DEPRECATED)** placement of closing parenthesis.
159159
- [**`expressionWidth`**](docs/expressionWidth.md) maximum number of characters in parenthesized expressions to be kept on single line.
160160
- [**`linesBetweenQueries`**](docs/linesBetweenQueries.md) how many newlines to insert between queries.
161161
- [**`denseOperators`**](docs/denseOperators.md) packs operators densely without spaces.

docs/multilineLists.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# multilineLists
1+
# multilineLists (DEPRECATED)
22

33
Determines when to break lists of items (e.g. columns in `SELECT` clause) to multiple lines.
44

@@ -116,3 +116,37 @@ SELECT first_name, last_name, occupation, age
116116
FROM persons
117117
GROUP BY age, occupation
118118
```
119+
120+
## Caveats
121+
122+
This option has problematic behavior when dealing with comma-separated items within parenthesis.
123+
124+
For example, with `multilineLists: "always"` you'd get this result:
125+
126+
```
127+
INSERT INTO
128+
records (25, 'John', 'Lennon', 1971, 'Imagine');
129+
130+
INSERT INTO
131+
records (
132+
26,
133+
'Michael',
134+
'Jackson',
135+
1997,
136+
'Blood on the Dance Floor'
137+
);
138+
```
139+
140+
Which is not really always.
141+
142+
And with `multilineLists: "avoid"` you'd get:
143+
144+
```
145+
INSERT INTO records (25, 'John', 'Lennon', 1971, 'Imagine');
146+
147+
INSERT INTO records (
148+
26, 'Michael', 'Jackson', 1997, 'Blood on the Dance Floor'
149+
);
150+
```
151+
152+
Which still breaks things to multiple lines, but with incorrect indentation.

docs/newlineBeforeCloseParen.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# newlineBeforeCloseParen
1+
# newlineBeforeCloseParen (DEPRECATED)
22

33
Decides whether to place close-parenthesis `)` of sub-queries on a separate line.
44

@@ -7,10 +7,6 @@ Decides whether to place close-parenthesis `)` of sub-queries on a separate line
77
- `true` (default) adds newline before close-parenthesis.
88
- `false` no newline.
99

10-
Caveats:
11-
12-
This option is ignored when `indentStyle: "tabularLeft"` or `"tabularRight"` is used.
13-
1410
### newlineBeforeCloseParen: true
1511

1612
```
@@ -37,3 +33,8 @@ FROM
3733
FROM
3834
my_table );
3935
```
36+
37+
## Caveats
38+
39+
- This option is ignored when `indentStyle: "tabularLeft"` or `"tabularRight"` is used.
40+
- This option is ignored when the parenthized content is smaller than `expressionWidth`.

docs/newlineBeforeOpenParen.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# newlineBeforeOpenParen
1+
# newlineBeforeOpenParen (DEPRECATED)
22

33
Decides whether to place open-parenthesis `(` of sub-queries on a separate line.
44

@@ -7,10 +7,6 @@ Decides whether to place open-parenthesis `(` of sub-queries on a separate line.
77
- `true` (default) adds newline before open-parenthesis.
88
- `false` no newline.
99

10-
Caveats:
11-
12-
This option is ignored when `indentStyle: "tabularLeft"` or `"tabularRight"` is used.
13-
1410
### newlineBeforeOpenParen: true
1511

1612
```
@@ -37,3 +33,9 @@ FROM (
3733
my_table
3834
);
3935
```
36+
37+
## Caveats
38+
39+
- This option is ignored when `indentStyle: "tabularLeft"` or `"tabularRight"` is used.
40+
- This option is ignored when the parenthized content is smaller than `expressionWidth`.
41+
- This option is ignored for function calls.

0 commit comments

Comments
 (0)