# Swift Format

**URL:** https://forums.swift.org/c/development/swift-format/49.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [About the Swift Format category](https://forums.swift.org/t/about-the-swift-format-category/26791)

<div class="topic-metadata">

**Author:** [@Nicole\_Jacque](https://forums.swift.org/u/Nicole_Jacque)\
**Replies:** 0

</div>

For developers to discuss the implementation of the formatting technology for Swift code.

---

## [Swift-format proposal: \`lint --non-fixable-only\`](https://forums.swift.org/t/swift-format-proposal-lint-non-fixable-only/87103)

<div class="topic-metadata">

**Author:** [@Val](https://forums.swift.org/u/Val)\
**Replies:** 0\
**Last updated:** [June 4, 2026, 2:24pm UTC](https://forums.swift.org/t/swift-format-proposal-lint-non-fixable-only/87103 "2026-06-04T14:24:57Z")

</div>

I’m working on a small swift-format lint addition and would like design feedback. The proposed flag is: swift-format lint --non-fixable-only It emits only findings that swift-format format cannot fix. The goal is to s…

---

## [\`swift-format\` roadmap?](https://forums.swift.org/t/swift-format-roadmap/84154)

<div class="topic-metadata">

**Author:** [@tera](https://forums.swift.org/u/tera)\
**Replies:** 2\
**Last updated:** [January 15, 2026, 7:09pm UTC](https://forums.swift.org/t/swift-format-roadmap/84154 "2026-01-15T19:09:28Z")

</div>

Is there a publicly available swift-format roadmap? swift-format semantic linting rules are quite basic at the moment. Are there long or mid-term plans to add more features to it? I'm now looking at the lack of this one…

---

## [I'm confused how to consistently format Swift code](https://forums.swift.org/t/im-confused-how-to-consistently-format-swift-code/81780)

<div class="topic-metadata">

**Author:** [@lukaszciastko](https://forums.swift.org/u/lukaszciastko)\
**Replies:** 5\
**Last updated:** [August 25, 2025, 12:01pm UTC](https://forums.swift.org/t/im-confused-how-to-consistently-format-swift-code/81780 "2025-08-25T12:01:47Z")

</div>

Hi, I’ve been trying to find a consistent way to format my code, but I’m confused how it all works… Is there a way to format code from command line in the same way Xcode (Format file with ‘swift-format’) or VS Code (Sh…

---

## [Avoiding Plugin Execution in a Linked Swift Package During Top-Level Package Builds](https://forums.swift.org/t/avoiding-plugin-execution-in-a-linked-swift-package-during-top-level-package-builds/80828)

<div class="topic-metadata">

**Author:** [@nareshreddywf](https://forums.swift.org/u/nareshreddywf)\
**Replies:** 0\
**Last updated:** [July 1, 2025, 12:51pm UTC](https://forums.swift.org/t/avoiding-plugin-execution-in-a-linked-swift-package-during-top-level-package-builds/80828 "2025-07-01T12:51:51Z")

</div>

I am working on an iOS project using Xcode 16.0 that leverages multiple Swift packages. Among these, I have a Shared Package that contains reusable code and is linked to several top-level feature packages (e.g., VideoPla…

---

## [Swift-format hangs without configuration](https://forums.swift.org/t/swift-format-hangs-without-configuration/79999)

<div class="topic-metadata">

**Author:** [@bbrk24](https://forums.swift.org/u/bbrk24)\
**Replies:** 3\
**Last updated:** [May 20, 2025, 12:42pm UTC](https://forums.swift.org/t/swift-format-hangs-without-configuration/79999 "2025-05-20T12:42:10Z")

</div>

Basically the title. If I run swift format -ir Sources/, it maxes out one CPU core and does nothing. I let it sit like this for a full two minutes. Then, I killed it and added --configuration "{}" and it finished in unde…

---

## [Tab Bar height and animation issue with 6 icons](https://forums.swift.org/t/tab-bar-height-and-animation-issue-with-6-icons/76592)

<div class="topic-metadata">

**Author:** [@BypassTaylorSwift](https://forums.swift.org/u/BypassTaylorSwift)\
**Replies:** 1\
**Last updated:** [December 13, 2024, 11:22am UTC](https://forums.swift.org/t/tab-bar-height-and-animation-issue-with-6-icons/76592 "2024-12-13T11:22:27Z")

</div>

Hello everyone, I'm new to this forum. I've been trying to customize my Tab Bar Controller for over 2 hours now. Since I want to use more than 5 icons, specifically 6 icons, I had to change my code from: Method 1: cla…

---

## [Prioritising breaking behaviour in swift-format](https://forums.swift.org/t/prioritising-breaking-behaviour-in-swift-format/76175)

<div class="topic-metadata">

**Author:** [@adam-fowler](https://forums.swift.org/u/adam-fowler)\
**Replies:** 5\
**Last updated:** [November 23, 2024, 9:05pm UTC](https://forums.swift.org/t/prioritising-breaking-behaviour-in-swift-format/76175 "2024-11-23T21:05:43Z")

</div>

How much control does swift-format give the user over prioritising where line breaks are made, specifically in function declarations and calls? The only configuration I can see so far is prioritizeKeepingFunctionOutputTo…

---

## [Default behavior of "swift format"](https://forums.swift.org/t/default-behavior-of-swift-format/74314)

<div class="topic-metadata">

**Author:** [@ktoso](https://forums.swift.org/u/ktoso)\
**Replies:** 35\
**Last updated:** [November 13, 2024, 11:20pm UTC](https://forums.swift.org/t/default-behavior-of-swift-format/74314 "2024-11-13T23:20:29Z")

</div>

Now that we're shipping swift format with toolchains in 6.0+ the following command became available "out of the box": swift format. This is fantastic development and I'm very happy that we finally have a "just run swift…

---

## [Data Visualization in Xcode from Satelite Data](https://forums.swift.org/t/data-visualization-in-xcode-from-satelite-data/75173)

<div class="topic-metadata">

**Author:** [@Sal](https://forums.swift.org/u/Sal)\
**Replies:** 0\
**Last updated:** [October 5, 2024, 9:55am UTC](https://forums.swift.org/t/data-visualization-in-xcode-from-satelite-data/75173 "2024-10-05T09:55:49Z")

</div>

q Hello everyone, I am using Xcode and trying to display Satelite data on my app, this is the link to the data i want to add: NASA Worldview However, I don’t know how to add it yet, I usually never get a view. Here …

---

## [SwiftSyntaxBuilder example code failing](https://forums.swift.org/t/swiftsyntaxbuilder-example-code-failing/62119)

<div class="topic-metadata">

**Author:** [@Devarshi](https://forums.swift.org/u/Devarshi)\
**Replies:** 2\
**Last updated:** [May 30, 2024, 10:05am UTC](https://forums.swift.org/t/swiftsyntaxbuilder-example-code-failing/62119 "2024-05-30T10:05:10Z")

</div>

I am trying to compile the SwiftSyntaxBuilder example code at GitHub. For some reasons it is failing for me with following error: Am I missing anything over here?

---

## [Are there any plans to better integrate swift-format with the swift language/tooling?](https://forums.swift.org/t/are-there-any-plans-to-better-integrate-swift-format-with-the-swift-language-tooling/60602)

<div class="topic-metadata">

**Author:** [@BrentM](https://forums.swift.org/u/BrentM)\
**Replies:** 2\
**Last updated:** [February 24, 2024, 7:55pm UTC](https://forums.swift.org/t/are-there-any-plans-to-better-integrate-swift-format-with-the-swift-language-tooling/60602 "2024-02-24T19:55:25Z")

</div>

For example rust and go both have a ‘fmt’ command that is pretty much built into the tooling. Go programs won’t even compile if your code isn’t styled correctly with gofmt. I know this feels pretty restrictive, but I f…

---

## [Swift-format as part of brew](https://forums.swift.org/t/swift-format-as-part-of-brew/60649)

<div class="topic-metadata">

**Author:** [@sergiocampama](https://forums.swift.org/u/sergiocampama)\
**Replies:** 9\
**Last updated:** [February 24, 2024, 7:53pm UTC](https://forums.swift.org/t/swift-format-as-part-of-brew/60649 "2024-02-24T19:53:52Z")

</div>

Now that swift-format in main uses the Swift rewrite of SwiftSyntax (as per the new notice in swift-format), does that mean that the compiled binary is no longer tied to the runtime libraries of the toolchain? What I was…

---

## [How to compile swift-format in Docker with latest ubuntu?](https://forums.swift.org/t/how-to-compile-swift-format-in-docker-with-latest-ubuntu/69400)

<div class="topic-metadata">

**Author:** [@lancejpollard](https://forums.swift.org/u/lancejpollard)\
**Replies:** 5\
**Last updated:** [January 12, 2024, 8:17pm UTC](https://forums.swift.org/t/how-to-compile-swift-format-in-docker-with-latest-ubuntu/69400 "2024-01-12T20:17:29Z")

</div>

I am getting this toward the end of the logs of installing swift-format: #73 70.09 \[41/45\] Compiling ArgumentParserToolInfo ToolInfo.swift #73 134.7 \[43/47\] Compiling ArgumentParser BashCompletionsGenerator.swift #73 14…

---

## [Swift and Objective C interoperability](https://forums.swift.org/t/swift-and-objective-c-interoperability/69191)

<div class="topic-metadata">

**Author:** [@Shikharani](https://forums.swift.org/u/Shikharani)\
**Replies:** 0\
**Last updated:** [December 28, 2023, 2:19pm UTC](https://forums.swift.org/t/swift-and-objective-c-interoperability/69191 "2023-12-28T14:19:42Z")

</div>

I am working on the project in which we are migrating from iOS project to framework. I am facing issue with Objective-C and swift interoperability. I have one Swift class let suppose profile, it has been exposed to obje…

---

## [Fixing line breaks](https://forums.swift.org/t/fixing-line-breaks/29620)

<div class="topic-metadata">

**Author:** [@Michael\_Gubik](https://forums.swift.org/u/Michael_Gubik)\
**Replies:** 8\
**Last updated:** [August 10, 2023, 2:59pm UTC](https://forums.swift.org/t/fixing-line-breaks/29620 "2023-08-10T14:59:43Z")

</div>

Hi, what's the best tool today to fix line break issues, like else on a new line like so } else { single empty lines between the function heads and bodies Array\<String\> → \[String\] (regex is ok, but maybe th…

---

## [Pass two arguments to .scan in timer.publish and print both on when function get called](https://forums.swift.org/t/pass-two-arguments-to-scan-in-timer-publish-and-print-both-on-when-function-get-called/65659)

<div class="topic-metadata">

**Author:** [@Naveenross](https://forums.swift.org/u/Naveenross)\
**Replies:** 0\
**Last updated:** [June 19, 2023, 7:33am UTC](https://forums.swift.org/t/pass-two-arguments-to-scan-in-timer-publish-and-print-both-on-when-function-get-called/65659 "2023-06-19T07:33:31Z")

</div>

I have timer method where it get called whenever new instance is created. I want every ticker should be stored in dictionary with respect to each instance like \[test1: 1, test2: 1\] , \[test1: 2, test2: 2\] ......So on var…

---

## [Swift-format and Package.resolved](https://forums.swift.org/t/swift-format-and-package-resolved/62627)

<div class="topic-metadata">

**Author:** [@sergiocampama](https://forums.swift.org/u/sergiocampama)\
**Replies:** 0\
**Last updated:** [January 18, 2023, 12:22pm UTC](https://forums.swift.org/t/swift-format-and-package-resolved/62627 "2023-01-18T12:22:28Z")

</div>

I know I asked this some time ago, but forgot where (since it's not in the forum apparently) and the answer was that the integration with the toolchain's swift syntax made it unfeasible. But now that all dependencies ar…

---

## [Swift-format 0.50600.0 adds newline after if/function opening brace sometimes?!](https://forums.swift.org/t/swift-format-0-50600-0-adds-newline-after-if-function-opening-brace-sometimes/57001)

<div class="topic-metadata">

**Author:** [@hassila](https://forums.swift.org/u/hassila)\
**Replies:** 3\
**Last updated:** [April 27, 2022, 8:56am UTC](https://forums.swift.org/t/swift-format-0-50600-0-adds-newline-after-if-function-opening-brace-sometimes/57001 "2022-04-27T08:56:55Z")

</div>

Just started playing with swift-format - built a new version 0.50600.0 which passes the full test suite on my M1 MacBook Pro (with a default 5.6 toolchain) and in just two places, it will consistently move the functions …

---

## [Using default configuration with overrides](https://forums.swift.org/t/using-default-configuration-with-overrides/56689)

<div class="topic-metadata">

**Author:** [@Jeehut](https://forums.swift.org/u/Jeehut)\
**Replies:** 0\
**Last updated:** [April 11, 2022, 5:18pm UTC](https://forums.swift.org/t/using-default-configuration-with-overrides/56689 "2022-04-11T17:18:15Z")

</div>

The Problem Currently, as per the documentation, we can either provide no configuration file to use the default config or provide a .swift-format file or a custom path to --configuration to use our own configuration. So …

---

## [Line break for the \`error\` word as the function parameter](https://forums.swift.org/t/line-break-for-the-error-word-as-the-function-parameter/56053)

<div class="topic-metadata">

**Author:** [@yellow-cap](https://forums.swift.org/u/yellow-cap)\
**Replies:** 5\
**Last updated:** [March 19, 2022, 3:53pm UTC](https://forums.swift.org/t/line-break-for-the-error-word-as-the-function-parameter/56053 "2022-03-19T15:53:53Z")

</div>

Hello, guys. Faced with this problem. Swift-format error shown, if I have the line break between the error word in the function parameters. swift-format shows an error: func test( error: Error ) { …

---

## [SwiftSyntax parser library isn't compatible](https://forums.swift.org/t/swiftsyntax-parser-library-isnt-compatible/31157)

<div class="topic-metadata">

**Author:** [@dannliu](https://forums.swift.org/u/dannliu)\
**Replies:** 24\
**Last updated:** [March 18, 2022, 8:12pm UTC](https://forums.swift.org/t/swiftsyntax-parser-library-isnt-compatible/31157 "2022-03-18T20:12:26Z")

</div>

Using commit: 94482c3e79f97e78575906da55f02e1c04f8e531 Xcode Version: 11.2.1 Swift Version: 5.1.2 Steps: 1. git clone GitHub - apple/swift-format: Formatting technology for Swift source code 2. cd swift-format 3. s…

---

## [Fix line breaks](https://forums.swift.org/t/fix-line-breaks/50391)

<div class="topic-metadata">

**Author:** [@maximkrouk](https://forums.swift.org/u/maximkrouk)\
**Replies:** 1\
**Last updated:** [November 17, 2021, 10:18am UTC](https://forums.swift.org/t/fix-line-breaks/50391 "2021-11-17T10:18:15Z")

</div>

I'd like to implement a fix myself, but I need some help The behavior I expect is let view = UIView { $0 .backgroundColor(.red) .layer.cornerRadius(12) } view.onTap(caputre { \_self in \_self.backgroundColor = .ra…

---

## [Support for swift-format on Xcode-beta 13.0b1?](https://forums.swift.org/t/support-for-swift-format-on-xcode-beta-13-0b1/50205)

<div class="topic-metadata">

**Author:** [@sergiocampama](https://forums.swift.org/u/sergiocampama)\
**Replies:** 9\
**Last updated:** [September 22, 2021, 12:04am UTC](https://forums.swift.org/t/support-for-swift-format-on-xcode-beta-13-0b1/50205 "2021-09-22T00:04:36Z")

</div>

So I'm building a library that supports 5.4 but would also like to support some newer async APIs when swift 5.5 is available. The problem I have is that the formatter in the 5.4 branch doesn't understand that try await …

---

## [Changing comment trivia attribution from trailing trivia to leading trivia](https://forums.swift.org/t/changing-comment-trivia-attribution-from-trailing-trivia-to-leading-trivia/50773)

<div class="topic-metadata">

**Author:** [@ahoppen](https://forums.swift.org/u/ahoppen)\
**Replies:** 8\
**Last updated:** [September 20, 2021, 2:37pm UTC](https://forums.swift.org/t/changing-comment-trivia-attribution-from-trailing-trivia-to-leading-trivia/50773 "2021-09-20T14:37:21Z")

</div>

The current rule how trivia are split between leading and trailing trivia, is that all trivia are trailing up to the first comment or newline. Thus, comments are always leading trivia of the next token. This, however, i…

---

## [Is swift-format is still active or dead?](https://forums.swift.org/t/is-swift-format-is-still-active-or-dead/44589)

<div class="topic-metadata">

**Author:** [@alaija](https://forums.swift.org/u/alaija)\
**Replies:** 10\
**Last updated:** [May 18, 2021, 12:44am UTC](https://forums.swift.org/t/is-swift-format-is-still-active-or-dead/44589 "2021-05-18T00:44:10Z")

</div>

Time ago there was some conversations about swift-format integration to swift toolchain here. But now It looks like swift-format development is stoped (a few PRs in repo, no answers in topics, etc) allevato can you con…

---

## [Build swift-format](https://forums.swift.org/t/build-swift-format/27344)

<div class="topic-metadata">

**Author:** [@hartbit](https://forums.swift.org/u/hartbit)\
**Replies:** 2\
**Last updated:** [July 31, 2019, 8:26am UTC](https://forums.swift.org/t/build-swift-format/27344 "2019-07-31T08:26:29Z")

</div>

Any ideas why I'm getting the following error when trying to build swift-format? I tried building SwiftSyntax on its own, next to the compiler repo, with the build-script.py script and I got the same error: swift-format…

---

## [0.50400.0 release?](https://forums.swift.org/t/0-50400-0-release/47719)

<div class="topic-metadata">

**Author:** [@SDGGiesbrecht](https://forums.swift.org/u/SDGGiesbrecht)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 10:50pm UTC](https://forums.swift.org/t/0-50400-0-release/47719 "2021-04-28T22:50:44Z")

</div>

This is a friendly reminder that it’s release time again and a 0.50400.0 tag would be appreciated for swift-syntax and swift-format. @allevato, @akyrtzi

---

## [Swift-format increases indent level for multi-line string literals each time it is run](https://forums.swift.org/t/swift-format-increases-indent-level-for-multi-line-string-literals-each-time-it-is-run/43626)

<div class="topic-metadata">

**Author:** [@BrentM](https://forums.swift.org/u/BrentM)\
**Replies:** 4\
**Last updated:** [January 8, 2021, 2:44am UTC](https://forums.swift.org/t/swift-format-increases-indent-level-for-multi-line-string-literals-each-time-it-is-run/43626 "2021-01-08T02:44:16Z")

</div>

The swift-format repo seems to have issues disabled so I cannot create an issue there. It seems that whenever I run the swift-format -m format command, It increases the indentation of multi-line string literals by 1 eac…

---

## [Document where to report bugs / suggestions](https://forums.swift.org/t/document-where-to-report-bugs-suggestions/41841)

<div class="topic-metadata">

**Author:** [@Jeehut](https://forums.swift.org/u/Jeehut)\
**Replies:** 1\
**Last updated:** [November 7, 2020, 8:46pm UTC](https://forums.swift.org/t/document-where-to-report-bugs-suggestions/41841 "2020-11-07T20:46:32Z")

</div>

As GitHub Issues is not turned on for the swift-format repository, thus currently it's unclear where to report bugs, change requests or ideas for new formatting/linting rules. I think it is important for the success of a…

[Next page](https://forums.swift.org/c/development/swift-format/49.md?page=1)
