Skip to content

Commit

Permalink
Enable consistentSwitchStatementSpacing by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Jun 9, 2024
1 parent e560703 commit 37e450e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* [conditionalAssignment](#conditionalAssignment)
* [consecutiveBlankLines](#consecutiveBlankLines)
* [consecutiveSpaces](#consecutiveSpaces)
* [consistentSwitchStatementSpacing](#consistentSwitchStatementSpacing)
* [duplicateImports](#duplicateImports)
* [elseOnSameLine](#elseOnSameLine)
* [emptyBraces](#emptyBraces)
Expand Down Expand Up @@ -94,7 +95,6 @@
* [blankLineAfterMultilineSwitchCase](#blankLineAfterMultilineSwitchCase)
* [blankLinesBetweenImports](#blankLinesBetweenImports)
* [blockComments](#blockComments)
* [consistentSwitchStatementSpacing](#consistentSwitchStatementSpacing)
* [docComments](#docComments)
* [isEmpty](#isEmpty)
* [markTypes](#markTypes)
Expand Down
3 changes: 0 additions & 3 deletions Sources/Rules.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,6 @@ public struct _FormatRules {
linewrapStack.append(false)
scopeStack.append(.operator("=", .infix))
scopeStartLineIndexes.append(lineIndex)
default:
// If this is the final `endOfScope` in a conditional assignment,
// we have to end the scope introduced by that assignment operator.
Expand Down Expand Up @@ -2116,7 +2115,6 @@ public struct _FormatRules {
if linewrapped, shouldIndentNextLine(at: i) {
indentStack[indentStack.count - 1] += formatter.options.indent
}
default:
break
}
Expand Down Expand Up @@ -7878,7 +7876,6 @@ public struct _FormatRules {

public let consistentSwitchStatementSpacing = FormatRule(
help: "Ensures consistent spacing among all of the cases in a switch statement.",
disabledByDefault: true,
orderAfter: ["blankLineAfterMultilineSwitchCase"]
) { formatter in
formatter.forEach(.keyword("switch")) { switchIndex, _ in
Expand Down

0 comments on commit 37e450e

Please sign in to comment.