Convert LineLengthRule to use SwiftSyntax instead of SourceKit for
improved performance and better detection accuracy.
The SwiftSyntax implementation:
- Uses ViolationsSyntaxVisitor pattern with line-based validation
- Pre-computes ignored lines using helper visitors for efficiency
- Implements pure SwiftSyntax comment detection without SourceKit
- Correctly handles function declarations, multiline strings
- Maintains all configuration options including URL stripping
- Preserves exact line position reporting for violations
Main goal is to bring implementations, rules and examples closer together.
Another advantage is that the rule's layouts are in line with other
`@SwiftSyntaxRule`s.
After the refactoring, violation messages can be
better adapted to the object causing the issue. Violation positions
should be harmonized and more cases for protocols, subscripts and
deinitializers can be added.
Convert FileLengthRule to use SwiftSyntax instead of SourceKit for
improved performance and fewer false positives.
The SwiftSyntax implementation:
- Uses ViolationsSyntaxVisitor pattern with token traversal
- Correctly handles multiline tokens by counting all spanned lines
- Properly excludes comment-only and whitespace-only lines
- Accurately attributes trivia to correct line positions
- Extracts common line range logic to reduce code duplication
With the binding of configurations to their associated rule types
"unknown configuration" errors can be made more specific mentioning
also the rule's identifier in the printed message.