Skip to content

Commit 130757b

Browse files
committed
Update swift-format documentation
Add information about the "indent-switch-case" option.
1 parent e0d017e commit 130757b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/SwiftFormat.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ If you want to indent using tabs instead of spaces, use the "-use-tabs" option:
3535
You can set the number of tabs or spaces using the "-tab-width" and
3636
"-indent-width" options, respectively.
3737

38+
If you want to indent cases in switch statements, use the "-indent-switch-case"
39+
option. The result would be something like this:
40+
41+
switch aSwitch {
42+
case .some(let s):
43+
print(s)
44+
3845
swift-format supports formatting a range of lines from a file:
3946

4047
swift-format -line-range 2:45 sample.swift

0 commit comments

Comments
 (0)