36 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
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
Danny Mösch 335edded41 Inline dedicated rule test (#6459) 2026-01-23 14:25:19 -05:00
Danny Mösch 32c33c2588 Re-enable redundant_self rule (#6368) 2025-12-07 08:11:08 -05:00
Danny Mösch 2e87be0398 Infer name of parent rule in configurations (#6363) 2025-12-01 14:15:00 -05:00
Danny Mösch f1562a629e Exclude only function signatures (#6348) 2025-11-18 17:27:53 +01:00
Danny Mösch 9e5a526483 Enable unneeded_throws_rethrows rule (#6335) 2025-11-03 20:24:57 +01: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
Copilot 5b9db55541 Convert multiline strings to string blocks (#6244)
Co-authored-by: SimplyDanny <16365760+SimplyDanny@users.noreply.github.com>
2025-09-08 19:33:57 +00:00
Danny Mösch dcbdcc92d1 Ignore function, initializer and subscript declarations alike (#6242) 2025-09-07 11:53:32 +02:00
Danny Mösch 4859fa8e82 Ensure that headers matched against always end in a newline (#6234) 2025-09-04 23:09:35 +02:00
Danny Mösch b97f63a89d Properly detect comment-only lines (#6230) 2025-09-03 23:42:04 +02:00
Danny Mösch 233908e28c Treat strings with opening and closing quotes in the same line as single-line strings (#6229) 2025-09-03 22:29:33 +02:00
Danny Mösch 57d6752a2a Merge function_name_whitespace and operator_whitespace rules (#6217) 2025-09-03 00:34:22 +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
Copilot 90820fcda3 Extend xct_specific_matcher rule to cover === and !== (#6184)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-08-09 09:03:13 -04:00
Danny Mösch a321566c05 Support protocols and extensions in type body length checking (#6143) 2025-07-11 22:27:47 +02:00
Danny Mösch 092d0c3b62 Keep severity levels unchanged when no options are configured (#6160) 2025-07-11 04:18:28 -04:00
Danny Mösch df96466163 Support deinitializers and subscripts in function body length checking (#6142) 2025-07-09 16:33:49 -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
Danny Mösch 18403e8604 Harmonize violation positions (#6124) 2025-06-21 17:15:25 +02:00
JP Simard 81474e36d0 Enforce SourceKitFreeRule contract with fatal error (#6107) 2025-06-20 07:25:01 -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
Henry ed20aa593d Add new option ignores_multiline_strings to line_length rule (#6014) 2025-04-03 14:28:41 -04:00
fraioli e68797ebea Respect macro types in file_name rule (#6027)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-03-22 20:55:18 -04:00
Danny Mösch 82fd3e4058 Ensure that content is complete using an awaitable stream (#5986) 2025-02-10 22:59:43 +01:00
Danny Mösch f796fee241 Enable strict concurrency checks in test code (#5943) 2025-01-07 22:19:25 +01:00
Koichiro Ueki fc70594ad2 Ignore TipKit's #Rule macro in empty_count rule (#5918)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-01-07 09:22:10 -05:00
Danny Mösch e53d06b4e5 Remove explicit framework dependency (#5928) 2024-12-30 15:09:10 +01:00
Danny Mösch 15b285527a Separate built-in rule tests from framework tests (#5924)
* Short names for test modules
* Lint plugins and `Package.swift` in integration tests
* Simplify and merge file groups in Bazel
* Move common functions to `TestHelpers`
2024-12-30 12:26:46 +01:00