Skip to content

Commit a021d60

Browse files
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 comments
1 parent 81474e3 commit a021d60

File tree

4 files changed

+699
-161
lines changed

4 files changed

+699
-161
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
* Migrate `vertical_whitespace` rule from SourceKit to SwiftSyntax for improved performance.
3030
[Matt Pennig](https://github.com/pennig)
3131

32+
* Migrate `statement_position` rule from SourceKit to SwiftSyntax for improved
33+
performance and fewer false positives.
34+
[JP Simard](https://github.com/jpsim)
35+
3236
### Bug Fixes
3337

3438
* Improved error reporting when SwiftLint exits, because of an invalid configuration file

0 commit comments

Comments
 (0)