Commit a021d60
committed
Migrate StatementPositionRule from SourceKit to SwiftSyntax
Convert StatementPositionRule to use SwiftSyntax instead of SourceKit for
improved performance and more accurate positioning validation.
The SwiftSyntax implementation:
- Uses ViolationsSyntaxVisitor and ViolationsSyntaxRewriter patterns
- Validates else/catch keyword positioning with proper indentation checks
- Supports both default (same line) and uncuddled (next line) modes
- Correctly handles trailing/leading trivia for whitespace validation
- Implements corrections using explicit rewriter for both statement types
- Extracts common validation logic to reduce code duplication
- Skip correcting when there are comments1 parent 81474e3 commit a021d60
File tree
4 files changed
+699
-161
lines changed- Source/SwiftLintBuiltInRules/Rules/Style
- Tests/BuiltInRulesTests
4 files changed
+699
-161
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
0 commit comments