Commit 853c3d8
Kapil Borle
Fix violations for one line switch conditionals (#709)
Consider the following expression:
switch ($x) {
{"a" -eq $_} {"a";break}
{"b" -eq $_} {"b";break}
}
If OnSameLine switch is `on`, this would get formatted to:
switch ($x) { {"a" -eq $_} {"a";break} {"b" -eq $_} {"b";break}
}
With this commit, it ignores these one-line conditional expression and so the output will be the same as the input in this case, i.e.,
switch ($x) {
{"a" -eq $_} {"a";break}
{"b" -eq $_} {"b";break}
}1 parent 9ef1119 commit 853c3d8
2 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
38 | 56 | | |
39 | 57 | | |
40 | 58 | | |
| |||
0 commit comments