Commit 11a125c
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 11a125c
File tree
4 files changed
+725
-161
lines changed- Source/SwiftLintBuiltInRules/Rules/Style
- Tests/BuiltInRulesTests
4 files changed
+725
-161
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
32 | 62 | | |
33 | 63 | | |
34 | 64 | | |
| |||
0 commit comments