🍺 BREW Explorer

← all formulae

swift-format

brew install swift-format v602.0.0 Apache-2.0

Command-line code formatter for Swift source code that powers SourceKit-LSP.

Why you might care

Provides consistent, automated formatting for Swift projects via CLI or as a Swift Package Manager dependency. Official tool from the Swift project; integrates with SourceKit-LSP for IDE support. Decoupled from Swift toolchain version as of 5.8, allowing broader compatibility.

Categories

Alternatives

swiftlint
1.8k
30-day installs · #1014
6.1k
90-day · #1004
26.8k
365-day · #937
2.9k
★ GitHub stars · updated 2d ago

Links

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [],
  "alternatives": [
    "swiftlint"
  ],
  "build_dependencies": [],
  "categories": [
    "formatter",
    "parser"
  ],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Formatting technology for Swift source code",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:41:16+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "swift-format",
  "github_default_branch": "main",
  "github_last_commit_at": "2026-06-18T17:53:37Z",
  "github_readme_excerpt": "# swift-format\n\n`swift-format` provides the formatting technology for\n[SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp) and the building\nblocks for doing code formatting transformations.\n\nThis package can be used as a [command line tool](#command-line-usage)\nor linked into other applications as a Swift Package Manager dependency and\ninvoked via an [API](#api-usage).\n\n\u003e NOTE: No default Swift code style guidelines have yet been proposed. The\n\u003e style that is currently applied by `swift-format` is just one possibility,\n\u003e and the code is provided so that it can be tested on real-world code and\n\u003e experiments can be made by modifying it.\n\n## Matching swift-format to Your Swift Version\n\n### Swift 5.8 and later\n\nAs of Swift 5.8, swift-format depends on the version of\n[SwiftSyntax](https://github.com/swiftlang/swift-syntax) whose parser has been\nrewritten in Swift and no longer has dependencies on libraries in the\nSwift toolchain.\n\nThis change allows `swift-format` to be built, developed, and run using\nany version of Swift that can compile it, decoupling it from the version\nthat supported a particular syntax. However, earlier versions of swift-format\nwill still not be able to recognize new syntax added in later versions of the\nlanguage and parser.\n\nNote also that the version numbering scheme has changed to match\nSwiftSyntax; the 5.8 release of swift-format is `508.0.0`, not `0.50800.0`.\n\n### Swift 5.7 and earlier\n\n`swift-format` versions 0.50700.0 and earlier depend on versions of\n[SwiftSyntax](https://github.com/swiftlang/swift-syntax) that used a standalone\nparsing library distributed as part of the Swift toolchain. When using these\nversions, you should check out and build `swift-format` from the release\ntag or branch that is compatible with the version of Swift you are using.\n\nThe major and minor version components of `swift-format` and SwiftSyntax must\nbe the same\u2014this is expressed in the `SwiftSyntax` dependency in\n[Package.swift](Package.swift)\u2014and those vers",
  "github_repo": "swiftlang/swift-format",
  "github_stars": 2937,
  "github_topics": [],
  "homepage": "https://github.com/swiftlang/swift-format",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 1841,
  "installs_365d": 26780,
  "installs_90d": 6131,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "Apache-2.0",
  "llm_generated_at": "2026-06-20T23:48:26+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "swift-format",
  "oldnames": [],
  "one_liner": "Command-line code formatter for Swift source code that powers SourceKit-LSP.",
  "optional_dependencies": [],
  "rank_30d": 1014,
  "rank_365d": 937,
  "rank_90d": 1004,
  "raw_hash": "fb321849b805ff89",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/s/swift-format.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [
    {
      "swift": "build"
    }
  ],
  "version_head": "HEAD",
  "version_stable": "602.0.0",
  "versioned_formulae": [],
  "why_use_this": "Provides consistent, automated formatting for Swift projects via CLI or as a Swift Package Manager dependency. Official tool from the Swift project; integrates with SourceKit-LSP for IDE support. Decoupled from Swift toolchain version as of 5.8, allowing broader compatibility."
}