118 Commits

Author SHA1 Message Date
Pavlo Tanaiev 9bc16b539b Fix indentation_width false positives for multi-line conditions (#6505)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2026-04-19 09:08:24 -04:00
Nadeem Ali 949cfe9889 Add new variable_shadowing rule (#6568)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2026-04-13 14:14:17 -04:00
Rodion Ivashkov a7878fcd67 Ignore case patterns in multiline_call_arguments (#6444)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2026-04-11 08:40:43 +02:00
Eduard Miniakhmetov c40896d3ad Add new invisible_characters rule (#6424)
Co-authored-by: Miniakhmetov Eduard <eminiakhmetov@sportmasterlab.net>
2026-04-07 14:06:59 +02:00
Nadeem Ali 2b91a5a691 Add detection of leading-dot to optional_data_string_conversion rule (#6372)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2026-03-30 08:35:37 +00:00
Danny Mösch 99ec4923d8 Use effective ACL in discouraged_default_parameter rule (#6563) 2026-03-27 21:25:37 +01:00
theamodhshetty 6dc566b7a5 Add underscore-prefixed option to unused_parameter rule (#6509) 2026-03-05 16:46:53 -05:00
William Laverty 87bfcc6832 Add disallow_default_parameter opt-in rule (#6506)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2026-03-05 16:22:21 -05:00
theamodhshetty 15d7a3d9ef Add ignore_attributes option to implicit_optional_initialization (#6513) 2026-02-28 10:52:08 +00:00
c 09f2fcaeb3 Skip force_unwrapping for calls with static string literal arguments (#6490)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2026-02-19 14:51:13 -05:00
Declan McKenna d3220ed108 Add ignore_regex option to large_tuple rule (#6452) 2026-01-24 14:52:12 +00:00
Danny Mösch 44f2ed46a9 Add only_in_closures option to redundant_self to maintain old behavior (#6406) 2026-01-03 07:16:11 -05:00
Danny Mösch 32c33c2588 Re-enable redundant_self rule (#6368) 2025-12-07 08:11:08 -05:00
Danny Mösch d1cdf8ce20 Extend redundant_self_in_closure to find all redundant selfs (#6346) 2025-12-07 07:49:50 -05:00
Danny Mösch 2e87be0398 Infer name of parent rule in configurations (#6363) 2025-12-01 14:15:00 -05:00
Rodion Ivashkov 31cdc24101 Add new multiline_call_arguments rule (#6223)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-11-30 18:16:11 -05:00
Danny Mösch 9e5a526483 Enable unneeded_throws_rethrows rule (#6335) 2025-11-03 20:24:57 +01:00
Danny Mösch b6c7e045a8 Add new separation option to vertical_whitespace_between_cases (#6334) 2025-11-02 08:53:25 -05:00
Nandhini Subramani 6619ca9c10 Add isolation parameter to modifier_order rule (#6316) 2025-10-22 09:40:45 +02:00
Danny Mösch 70a2e6ceac Add new incompatible_concurrency_annotation rule (#6290) 2025-10-20 15:11:10 -04:00
Nandhini Subramani 2c2ca671ed Add ignores_literals option to trailing_whitespace rule (#6309) 2025-10-18 04:31:52 -04:00
Nandhini Subramani a17dc04012 Add option to ignore regex literals in line_length rule (#6307) 2025-10-16 20:10:32 +02:00
Danny Mösch 4065fc8437 Enable upcoming feature MemberImportVisibility (#6286) 2025-10-08 08:12:05 +02:00
Danny Mösch a6247c24e4 Rewrite sorted_imports rule with SwiftSyntax (#6280) 2025-10-05 17:00:27 +02:00
Danny Mösch aa67f5ac13 Adopt typed throws where possible (#5922) 2025-09-27 19:11:46 +02:00
Rodion Ivashkov 91b26549c4 Add function_name_whitespace rule to validate and autocorrect spacing around function names (#6156)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-08-30 10:40:44 -04:00
André Pacheco Neves fe099492f2 Allow prefer_key_paths to ignore identity closures ({ $0 }) (#6068)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-08-15 00:30:10 +03:00
Leopold Lemmermann 2677d5ee6e Add new implicit_optional_initialization replacing redundant_optional_initialization (#6165)
The new rule covers both cases, initialization with `= nil` and without, consistently.

Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-08-13 10:08:49 +00:00
Copilot 8bb69b064a Add include_variables option to non_optional_string_data_conversion rule (#6172)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-08-02 17:49:58 -04:00
Danny Mösch c1ffdfe891 Enable prefer_condition_list rule (#6163) 2025-07-12 09:41:00 -04:00
Danny Mösch a321566c05 Support protocols and extensions in type body length checking (#6143) 2025-07-11 22:27:47 +02:00
Chris Brakebill c97cf24797 Add ignore_codingkeys parameter in nesting rule (#5650)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-07-09 15:09:38 -04:00
Danny Mösch 599e51a5a2 Format code (#6151) 2025-07-02 17:50:53 -04:00
Koichiro Ueki e65767baf8 Add new excluded_paths option to file_name rule (#6092)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-06-25 21:30:32 +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
JP Simard 5a2cf4b1fe Remove dead code (#6125)
In particular lots of stuff that used to be needed with SourceKit that
we no longer need to keep around.

Identified using Periphery: https://github.com/peripheryapp/periphery
2025-06-21 15:19:37 -04:00
Matt Pennig 1e25cf6be6 Migrate VerticalWhitespaceRule from SourceKit to SwiftSyntax (#6103)
* Migrate VerticalWhitespaceRule from SourceKit to SwiftSyntax

* Adds tests for new horizontal whitespace behavior
2025-06-19 17:31:51 -04:00
Kent Kaseda e1ac6f8607 Remove validates_start_with_lowercase option entirely (#6077) 2025-05-15 16:48:00 -04:00
Martin Redington 3ed7579fd2 Allow magic numbers to be configured (#6051) 2025-04-13 21:08:42 +01:00
Henry ed20aa593d Add new option ignores_multiline_strings to line_length rule (#6014) 2025-04-03 14:28:41 -04:00
Jared Grubb 63fea48d83 Add excluded_methods option to unneeded_override rule (#6010) 2025-03-22 21:40:05 +01:00
Eduard Miniakhmetov d2d1aacaac Add new allowed_types option to legacy_objc_type rule (#6012) 2025-03-10 09:28:04 +00:00
Danny Mösch 9b22cda361 Add ib_segue_action to default configuration (#5956) 2025-01-14 21:50:11 +01:00
Danny Mösch ae8aeb3995 Add option to disable redundant_discardable_let in SwiftUI view bodies (#5929) 2025-01-03 19:30:35 +01:00
Danny Mösch bef8acfb0e Avoid NSRegularExpression in configurations (#5921) 2024-12-28 12:54:23 -05:00
Danny Mösch 03f8c83d0d Add new redundant_sendable rule (#5902) 2024-12-25 23:05:02 +01:00
Martin Redington deaacf6f69 Fixed PrivateUnitTestRule deprecations (#5912) 2024-12-25 19:43:27 +00:00
Dinesh Sharma 8e3b50fa61 Add new category for @IBSegueAction to type_contents_order rule (#5524)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2024-12-14 18:02:54 -05:00
fraioli b9d33e43ec Update file_name rule to allow fully-qualified names of nested types (#5841) 2024-11-26 21:47:49 +01:00
Kim de Vos 2a723d0042 Add new option max_number_of_single_line_parameters to multiline_parameters rule (#5781)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2024-11-24 14:14:08 +00:00