Danny Mösch
4065fc8437
Enable upcoming feature MemberImportVisibility ( #6286 )
2025-10-08 08:12:05 +02:00
Danny Mösch
aa67f5ac13
Adopt typed throws where possible ( #5922 )
2025-09-27 19:11:46 +02:00
JP Simard
ab7d117030
Migrate FileHeaderRule from SourceKit to SwiftSyntax ( #6112 )
...
## Summary
Convert FileHeaderRule to use SwiftSyntax instead of SourceKit for
improved performance and better handling of file header comments,
shebangs, and doc comments.
## Key Technical Improvements
- **Enhanced shebang support** properly skipping past `#!/usr/bin/env swift` lines
- **Better comment type discrimination** excluding doc comments from header analysis
- **Accurate position calculation** converting between UTF-8 and UTF-16 offsets for regex matching
- **Improved trivia traversal** for comprehensive header comment collection
- **SwiftLint command filtering** to exclude directive comments from header content
## Migration Details
- Replaced `OptInRule` with `@SwiftSyntaxRule(optIn: true)` annotation
- Implemented `ViolationsSyntaxVisitor` pattern for file-level analysis
- Added logic to start header collection after shebang.endPosition if present
- Distinguished between regular comments and doc comments (///, /** */)
- Maintained UTF-16 offset calculations for NSRegularExpression compatibility
- Added `skipDisableCommandTests: true` for SwiftSyntax disable command behavior
- Removed unnecessary SourceKittenFramework import
2025-06-24 09:48:25 -04:00
Danny Mösch
bef8acfb0e
Avoid NSRegularExpression in configurations ( #5921 )
2024-12-28 12:54:23 -05:00
Martin Redington
3421f5f46d
Enable multiline_parameters rule, and fix all cases ( #5664 )
2024-07-18 01:48:02 +01:00
Martin Redington
ed10aec5f8
Enable implicit_return and fix all violations ( #5658 )
2024-07-10 12:15:19 +01:00
Danny Mösch
ccd50e8c68
Merge duplicated issues
2024-03-24 09:36:18 +01:00
Danny Mösch
0934c18cba
Let RuleConfigurations be equatable by default ( #5257 )
2023-10-03 18:05:31 +02:00
Danny Mösch
2433e7b5bf
Make use of macros to generate configuration parsing code ( #5250 )
2023-10-02 22:35:24 +02:00
Danny Mösch
ac81139942
Provide projectedValue to refer to option name ( #5098 )
2023-07-05 00:05:04 +02:00
Danny Mösch
678cd6f805
Introduce a model for rule configuration description ( #3931 )
2023-07-03 22:47:30 +02:00
Danny Mösch
3f039f26d5
Connect configs with their referencing rules to have some context in error logging ( #5017 )
...
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.
2023-05-19 20:58:24 +02:00
Danny Mösch
7fd22e0d6e
Use SeverityBasedRuleConfiguration where possible ( #5019 )
2023-05-18 16:04:20 +02:00
Danny Mösch
405113f793
Open ConfigurationError up to be used more broadly ( #5005 )
2023-05-14 20:00:46 +02:00
JP Simard
a7bc9e20c7
Move built-in rules to new SwiftLintBuiltInRules module ( #4950 )
2023-04-27 11:16:01 -04:00