Skip to content

Commit 11a125c

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 11a125c

File tree

4 files changed

+725
-161
lines changed

4 files changed

+725
-161
lines changed

CHANGELOG.md

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

32+
* Migrate `file_header` rule from SourceKit to SwiftSyntax for improved
33+
* Migrate `closure_end_indentation` rule from SourceKit to SwiftSyntax for improved
34+
* Migrate `accessibility_label_for_image` rule from SourceKit to SwiftSyntax for improved
35+
performance and fewer false positives.
36+
[JP Simard](https://github.com/jpsim)
37+
38+
* Migrate `accessibility_trait_for_button` rule from SourceKit to SwiftSyntax for improved
39+
performance and fewer false positives.
40+
[JP Simard](https://github.com/jpsim)
41+
42+
* Migrate `expiring_todo` rule from SourceKit to SwiftSyntax for improved performance
43+
and fewer false positives.
44+
[JP Simard](https://github.com/jpsim)
45+
46+
* Migrate `closure_end_indentation` rule from SourceKit to SwiftSyntax for improved
47+
performance and fewer false positives.
48+
[JP Simard](https://github.com/jpsim)
49+
50+
* Migrate `file_header` rule from SourceKit to SwiftSyntax for improved
51+
performance and fewer false positives.
52+
[JP Simard](https://github.com/jpsim)
53+
54+
* Migrate `line_length` rule from SourceKit to SwiftSyntax for improved
55+
performance and fewer false positives.
56+
[JP Simard](https://github.com/jpsim)
57+
58+
* Migrate `statement_position` rule from SourceKit to SwiftSyntax for improved
59+
performance and fewer false positives.
60+
[JP Simard](https://github.com/jpsim)
61+
3262
### Bug Fixes
3363

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

0 commit comments

Comments
 (0)