Closed calda closed 5 months ago
Attention: 1 lines
in your changes are missing coverage. Please review.
Comparison is base (
0fb8edc
) 95.07% compared to head (d96e18b
) 95.15%.
Files | Patch % | Lines |
---|---|---|
Sources/FormattingHelpers.swift | 98.88% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR adds two new rules related to blank lines in switch statements.
blankLineAfterMultilineSwitchCase
This rule inserts a blank line following any switch statement case that spans multiple lines:
consistentSwitchStatementSpacing
This rule ensures that the cases in a switch statement have consistent spacing. If the majority of cases have a blank line, then all cases should have a blank line. This is complimentary with the above rule, and improves cases like this:
This rule also works in the other direction, and will remove unnecessary blank lines if the majority of cases don't have one:
Combined example
These two rules compliment each other and combine nicely. When both rules are enabled, they will take a complex switch statement like the one below and add a blank line after all of the cases:
while preserving the common pattern where simple switch statements don't use any blank lines: