206 Commits

Author SHA1 Message Date
Copilot 11d06cca71 Fix spaceAroundParens incorrectly inserting space before Optional.some(...) in subsequent @Test arguments (#2526)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-05-05 08:17:02 -07:00
SUTHEESH SUKUMARAN cf424cb2b3 Add --line-wrap-threshold option for length-based wrapping (#2510) 2026-04-27 07:19:05 -07:00
Copilot 8b998f030d Fix redundantStaticSelf false positive inside closures and nested functions (#2518)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-04-27 07:01:13 -07:00
Copilot d8245dbba7 Fix closing brace indentation with --trimwhitespace nonblank-lines (#2477)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-04-11 12:26:55 -07:00
Copilot ebcb440df9 Avoid wrapping inside parens of function declarations with no parameters (#2467)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-04-11 12:26:55 -07:00
Copilot 9d60158a4a Fix spaceAroundParens incorrectly removing space after nonisolated(nonsending) modifier (#2460)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-04-11 12:26:54 -07:00
Copilot dce393fe93 Update --self-required to support assignment type names like OSLogMessage (#2448)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-04-11 12:26:54 -07:00
Copilot f00ffbcd17 Fix redundantSelf inserting self. inside #if/#elseif compiler directive conditions (#2436)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-04-11 12:26:54 -07:00
Copilot d2027b4095 Improve handling of switch statements with nested #if blocks (#2412)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-03-03 08:09:28 -08:00
Copilot 38d5a380ec Improve handling of switch statements with #if blocks (#2408)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-03-03 08:09:28 -08:00
Copilot 54ab2c763a Ensure wrap rule places linebreaks before :: operator, not after (#2400)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-03-03 08:09:28 -08:00
Copilot 09f803fb31 Fix redundantSelf removing self in guard let else when parameter shadows property (#2386)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-03-03 08:09:28 -08:00
Copilot c40b283622 Add --suite-name-format option to swiftTestingTestCaseNames rule (#2384)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-03-03 08:09:28 -08:00
Copilot 12748eb5bf Fix issue where redundantSelf rule didn't probably handle usage of guard let variable before guard statement or within else block (#2374)
Co-authored-by: Cal Stephens <cal@calstephens.tech>
2026-03-03 08:09:28 -08:00
Copilot 3681df84d6 Fix redundantSelf parsing error with switch expression in if let condition (#2369)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-03-03 08:09:27 -08:00
Copilot 3bc29e1ea9 Fix guard…else indentation in wrapArguments with wrap-conditions (#2368)
Co-authored-by: calda <1811727+calda@users.noreply.github.com>
2026-03-03 08:09:27 -08:00
Cal Stephens 5b7bab1983 Add --test-case-name-format raw-identifiers option to swiftTestingTestCaseNames rule (enabled by default) (#2359) 2026-03-03 08:09:27 -08:00
Cal Stephens 22a472ced4 Update for 0.59.1 release 2026-01-29 19:55:41 -08:00
Cal Stephens c402af2674 Update spaceAroundBrackets to preserve space after global actor attribute before closure capture list (#2347) 2026-01-29 19:53:51 -08:00
Cal Stephens 53c804f5e8 Avoid conflict with format.sh by excluding Sources from regression tests 2026-01-29 19:53:51 -08:00
Cal Stephens 2fcc583d76 Use doc comments before local functions 2026-01-29 19:53:51 -08:00
Cal Stephens 32f61584d0 Update redundantSelf rule to support functions with no body (#2315) 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 b755b34f69 Wrap closing paren of single-argument functions and collections if needed (#2281) 2026-01-25 09:02:04 -08:00
Nick Lockwood bf498a9bf3 Fix various edge cases for spaceAroundBrackets 2026-01-25 09:02:04 -08:00
Nick Lockwood bc2cca2d60 Fix redundantSelf bug with if #available checks 2025-11-29 12:00:02 +00:00
Nick Lockwood 4fab7f8897 Fix hoistTry bug with wrapped lines 2025-11-29 12:00:02 +00:00
Nick Lockwood 0262f75c0b Keep trailing comments with line when wrapping 2025-11-11 21:04:58 +00:00
Nick Lockwood 62ac33bc0a Add Token.isMacro helper 2025-10-16 07:16:56 +01:00
Nick Lockwood a605b2854c Fix unexpected wrapping of closing paren 2025-10-04 14:26:21 +01:00
Nick Lockwood 60cd0f8ab6 Fix bug with parsing empty property accessors 2025-10-04 09:25:55 +01:00
Nick Lockwood 6ea6ae64c7 Add new rules to project .swiftformat file 2025-10-04 08:46:46 +01:00
Cal Stephens 9fbd4f0909 Add redundantAsync rule (#2207) 2025-09-22 19:13:36 -07:00
Cal Stephens 5e7882baa8 Improve type-related helpers by adding TypeName type (#2187) 2025-09-22 19:13:36 -07:00
Cal Stephens 832e06822d Add option to disallow partial wrapping of functions and collections (#2186) 2025-09-22 19:13:36 -07:00
Cal Stephens 1e2aac8da6 Add support for Swift 6.2 raw identifiers (#2166) 2025-09-22 19:13:35 -07:00
Cal Stephens 5bd55188f1 Fix issue where hoistTry rule could break @Test attributes containing try (#2152) 2025-09-22 19:13:35 -07:00
Cal Stephens eae5180f6d Update --wrap-return-type never to work with --allman true (#2132) 2025-07-13 11:32:06 -07:00
Nick Lockwood d866f44049 Support :this and :previous in comment directives 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
Milo (Amir) Ardalan d2fba2c7fe Add --typeblanklines insert option to blankLinesAtStartOfScope and blankLinesAtEndOfScope rules
Co-authored-by: Cal Stephens <cal.stephens@airbnb.com>
2025-07-13 11:32:06 -07:00
Cal Stephens e6b2ce5e6a Add option to disable line wrapping within string interpolation (#2059) 2025-07-13 11:32:06 -07:00
Nick Lockwood c42207bd41 Update .swiftformat swiftfversion 2025-07-13 11:32:06 -07:00
Cal Stephens 6ebb96ce45 Update for 0.56.4 release 2025-06-15 09:12:56 -07:00
Cal Stephens 4f8365dcab Update organizeDeclarations / parseDeclarations to support property declarations with if expression values (#2046) 2025-05-13 19:56:49 -07:00
Cal Stephens 0a0554e718 Update parseFunctionDeclaration to parse where clause explicitly instead of using unreliable endOfDeclaration helper
This fixes bugs where endOfDeclaration returning unexpected results in certain cases, like if the declaration was the last in a type body or a nested function, which would result in the parsed function incorrectly having `bodyRange: nil`
2025-05-12 20:18:43 -07:00
Cal Stephens 6efd3d9ca0 Fix open paren wrapping edge case with closures and wrapped return 2025-05-12 20:18:43 -07:00
Cal Stephens 29bf8aa7ce Update opaqueGenericParameters rule to support protocol requirements 2025-05-12 20:18:43 -07:00
Mike Kasianowicz b2b8562c93 wrapreturntype: never (#2016) 2025-05-12 20:18:43 -07:00
Cal Stephens 782e9522b9 Update --wrapeffects and --wrapreturntype to support protocol requirements (#2018) 2025-05-12 20:18:43 -07:00