41 Commits

Author SHA1 Message Date
SUTHEESH SUKUMARAN 78836b9959 Replace objc string methods with swift equivalents #2292 (#2491)
Add preferSwiftStringAPI rule (#2292)

Replaces the Objective-C bridged `replacingOccurrences(of:with:)` with
Swift-native `replacing(_:with:)`. The ObjC method has known Unicode
bugs (e.g. corrupting emoji flag sequences); the Swift equivalent is
safer, shorter, and available from Swift 5.7+.

Only the two-argument form is transformed — calls with `options:` or
`range:` are left unchanged as they have no direct Swift equivalent.
2026-04-11 12:26:55 -07:00
Kim de Vos d798a8a5e3 Add new format rule for wrapping case bodies (#2476) 2026-04-11 12:26:55 -07:00
Manny Lopez 54f63a3822 Add redundantEmptyView rule (#2470) 2026-04-11 12:26:55 -07:00
Copilot 7872f50c73 Deprecate redundantProperty rule, rename to redundantVariable (#2433)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-03-07 08:37:31 -08:00
NachoSoto e7347a7315 Add redundantSendable rule (#2394) 2026-03-03 08:09:28 -08:00
Copilot aaedb601ea Add redundantSwiftTestingSuite rule (#2385)
Co-authored-by: Cal Stephens <cal@calstephens.tech>
2026-03-03 08:09:28 -08:00
Giyeop Hyeon (Jamie) 0c8a4613ef Add preferExplicitFalse rule (#2357) 2026-03-03 08:09:27 -08:00
Manny Lopez 3d4dc98a01 Split wrapSingleLineBodies into wrapPropertyBodies and wrapFunctionBodies (#2298) 2026-01-25 09:02:04 -08:00
Miguel Jimenez b993e17594 Add redundantViewBuilder Rule (#2297) 2026-01-25 09:02:04 -08:00
Manny Lopez 688ff0cae6 Add wrapSingleLineBodies rule (#2295) 2026-01-25 09:02:04 -08:00
Cal Stephens b8984b48be Add validateTestCases and testSuiteAccessControl rules (#2249) 2026-01-25 09:02:04 -08:00
Manny Lopez 0a0ec17cf3 Add simplifyGenericConstraints rule (#2243) 2026-01-25 09:02:04 -08:00
Cal Stephens 9fbd4f0909 Add redundantAsync rule (#2207) 2025-09-22 19:13:36 -07:00
Cal Stephens cd87505ae5 Add redundantThrows rule (#2206) 2025-09-22 19:13:36 -07:00
Cal Stephens 5e82ae3ad6 Rename throwingTests rule to noForceTryInTests 2025-09-22 19:13:36 -07:00
Cal Stephens 703593f551 Add noForceUnwrapInTests rule (#2204) 2025-09-22 19:13:36 -07:00
Cal Stephens fbbe980923 Add preferFinalClasses rule (#2196) 2025-09-22 19:13:36 -07:00
Cal Stephens 20ede999db Add singlePropertyPerLine rule (#2113) 2025-07-13 11:32:06 -07:00
Miguel Jimenez 0b7afe0cdb Add Redundant struct Member wise Init rule (#2098) 2025-07-13 11:32:06 -07:00
Manny Lopez 6759036fa8 Add urlMacro rule to prefer #URL(...) macro to force-unwrapped initializer URL(...)! (#2095) 2025-07-13 11:32:06 -07:00
Cal Stephens bb8dedd01f Add noGuardInTests rule to convert guard statements to #require / XCTUnwrap, etc (#2089) 2025-07-13 11:32:06 -07:00
Andy Bartholomew 8862bd4578 Prefer throwing tests to using try! (#2074) 2025-07-13 11:32:06 -07:00
Cal Stephens 760c32756c Add rule to remove redundant public access control from declarations in internal types (#2075) 2025-07-13 11:32:06 -07:00
Cal Stephens 595675a9e2 Add new rule to keep declaration modifiers on same line (#2073) 2025-07-13 11:32:06 -07:00
Cal Stephens 08b0e0ad33 Rename spacingGuards rule to blankLinesAfterGuardStatements (#2036) 2025-05-12 20:19:20 -07:00
Eric Horacek 184cd81df5 Add multiline function chains rule (#1981) 2025-05-12 20:18:43 -07:00
Cal Stephens f74a865760 Add swiftTestingTestCaseNames rule (#1979) 2025-05-12 20:18:43 -07:00
Cal Stephens 31b39bf9a3 Add rule to prefer Swift Testing over XCTest 2025-05-12 20:18:43 -07:00
Cal Stephens 4aa152bc3e Add preferCountWhere rule (#1939) 2025-05-12 20:18:43 -07:00
Miguel Jimenez 93afcd1084 Add rule to use @Entry macro instead of EnvironmentKeys (#1908) 2025-05-12 20:18:43 -07:00
Cal Stephens f10bc6f374 Rename noFileID rule to fileMacro, support preferring either #file or #fileID 2025-05-12 20:18:42 -07:00
Cal Stephens 9b8d131d43 Add noFileID rule that relies on Swift 6 language mode 2025-05-12 20:18:42 -07:00
Cal Stephens d2ea346884 Add rule to remove redundant Equatable implementations 2025-05-12 20:18:42 -07:00
Dave Paul 46b3afc372 Add new rule to ensure @State properties are private 2025-05-12 20:18:42 -07:00
NikeKov a426017c23 [New rule] spacingGuards (#1804) 2025-05-12 20:18:42 -07:00
Nick Lockwood c51b3f6718 Rename emptyExtension to emptyExtensions 2025-05-12 20:18:42 -07:00
Manny Lopez 47b6ba1bae Add emptyExtension rule + tests (#1792) 2025-05-12 20:18:42 -07:00
Nick Lockwood 2106a86e07 Rename unusedPrivateDeclaration to unusedPrivateDeclarations 2024-11-16 20:23:02 +00:00
Nick Lockwood 4a57064842 Update docCommentsBeforeAttributes to apply to all modifiers 2024-11-16 20:23:01 +00:00
Nick Lockwood add0c34108 Rename propertyType rule to propertyTypes 2024-11-16 20:23:01 +00:00
Cal Stephens 6ce3bd52c1 Implement each rule in a separate file (#1782) 2024-11-09 11:26:22 +00:00