Commit 588f3a8
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 f7f3caa commit 588f3a8
File tree
4 files changed
+696
-161
lines changed- Source/SwiftLintBuiltInRules/Rules/Style
- Tests/BuiltInRulesTests
4 files changed
+696
-161
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
0 commit comments