{"id":19521457,"url":"https://github.com/vknabel/vscode-apple-swift-format","last_synced_at":"2025-09-29T05:31:51.372Z","repository":{"id":54476370,"uuid":"223215822","full_name":"vknabel/vscode-apple-swift-format","owner":"vknabel","description":"VS Code extension for formatting Swift code with apple/swift-format.","archived":false,"fork":false,"pushed_at":"2024-11-21T06:13:45.000Z","size":280,"stargazers_count":33,"open_issues_count":6,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-13T01:09:02.361Z","etag":null,"topics":["formatter","hacktoberfest","prettifier","swift","swift-format","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-apple-swift-format","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vknabel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"vknabel","custom":["https://www.paypal.me/valentinknabel"]}},"created_at":"2019-11-21T16:22:32.000Z","updated_at":"2024-12-07T00:56:01.000Z","dependencies_parsed_at":"2024-06-26T06:40:14.463Z","dependency_job_id":"7a151e11-55c4-4ad0-800d-c3b269576f46","html_url":"https://github.com/vknabel/vscode-apple-swift-format","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vknabel%2Fvscode-apple-swift-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vknabel%2Fvscode-apple-swift-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vknabel%2Fvscode-apple-swift-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vknabel%2Fvscode-apple-swift-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vknabel","download_url":"https://codeload.github.com/vknabel/vscode-apple-swift-format/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234595752,"owners_count":18857715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formatter","hacktoberfest","prettifier","swift","swift-format","vscode","vscode-extension"],"created_at":"2024-11-11T00:32:19.676Z","updated_at":"2025-09-29T05:31:51.367Z","avatar_url":"https://github.com/vknabel.png","language":"TypeScript","funding_links":["https://github.com/sponsors/vknabel","https://www.paypal.me/valentinknabel"],"categories":[],"sub_categories":[],"readme":"# apple/swift-format for VS Code\n\nNon-official VS Code extension to prettify your Swift code automatically via [apple/swift-format](https://github.com/apple/swift-format). You can\nuse apple/swift-format installed globally or via the Swift Package Manager.\n\n\u003e There are two formatters for Swift code. Use this extension if you wish to use [apple/swift-format](https://github.com/apple/swift-format).\n\u003e Use [SwiftFormat](https://github.com/vknabel/vscode-swiftformat) if you want to use [nicklockwood/SwiftFormat](https://github.com/nicklockwood/SwiftFormat).\n\n### Global Installation\n\nYou can [install](https://github.com/apple/swift-format#matching-swift-format-to-your-swift-version) apple/swift-format globally using [Homebrew](https://brew.sh), [Mint](https://github.com/yonaskolb/Mint) or manually.\n\n```bash\n# Using Mint\n$ mint install apple/swift-format@release/5.8\n# Using Homebrew\n$ brew install swift-format\n# Manually\n$ git clone -b release/5.8 https://github.com/apple/swift-format.git\n$ swift build -c release\n```\n\n\u003e **Attention:** Pick the same branch name to install `apple/swift-format` as your Swift version! E.g. `swift-5.5-branch` for Swift `5.5` and `release/5.6` for `5.6`. For a complete and up-to-date mapping, see [apple/swift-format#Matching Swift Format to your Swift version](https://github.com/apple/swift-format#matching-swift-format-to-your-swift-version).\n\n### Local Installation\n\nAdd the package to your dependencies in `Package.swift`:\n\n```diff\n// swift-tools-version:5.8\n\nimport PackageDescription\n\nlet package = Package(\n    name: \"Komondor\",\n    products: [ ... ],\n    dependencies: [\n        // My dependencies\n        .package(url: \"https://github.com/orta/PackageConfig.git\", from: \"0.0.1\"),\n        // Dev deps\n        .package(url: \"https://github.com/orta/Komondor.git\", from: \"0.0.1\"),\n+        .package(url: \"https://github.com/apple/swift-format.git\", from: \"601.0.0\"),\n    ],\n    targets: [...]\n)\n```\n\n\u003e **Attention:** Pick the same branch name to install `apple/swift-format` as your Swift version! E.g. `swift-5.5-branch` for Swift `5.5` and `release/5.6` for `5.6`. For a complete and up-to-date mapping, see [apple/swift-format#Matching Swift Format to your Swift version](https://github.com/apple/swift-format#matching-swift-format-to-your-swift-version).\n\n## Configuration\n\n| Config                                           | Type       | Default             | Description                                                   |                                                                                                         |\n| ------------------------------------------------ | ---------- | ------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |\n| `apple-swift-format.enable`                      | `Bool`     | `true`              | Whether apple/swift-format should actually do something.      |                                                                                                         |\n| `apple-swift-format.onlyEnableOnSwiftPMProjects` | `Bool`     | `false`             | Requires and uses an apple/swift-format as SwiftPM dependency. This will cause the extension to build the Swift package upon first launch.                              |                                                                                                         |\n| `apple-swift-format.onlyEnableWithConfig`        | `Bool`     | `false`             | Only format if config present.                                |                                                                                                         |\n| `apple-swift-format.path`                        | `[String] \\| String` | platform dependent           | `swift-format`                                                | The location of the globally installed SwiftFormat (resolved with the current path if only a filename). |\n| `apple-swift-format.configSearchPaths`           | `[String]` | `[\".swift-format\"]` | Possible paths for apple/swift-format config.                 |                                                                                                         |\n\nNote that when `apple-swift-format.onlyEnableOnSwiftPMProjects` is enabled, the extension will only run `swift-format`\nexecutables built as part of the Swift package open in the workspace. It will try to build the binary once on first\nlaunch. If the build fails, the extension will not fall back to a globally installed `swift-format`. If you prefer a\nlocally built `swift-format`, but want to skip the automatic initial build, let `apple-swift-format.path` point to the\nlocal executable you have built manually or by other means independent of the extension.\n\n## FAQs\n\n### How do I enable formatting on type?\n\nTo enable formatting on while typing code without saving, simply enable the setting `\"editor.formatOnType\": true`.\nIn case you only want to enable it when editing Swift files, you can override as [`[swift]` language specific setting](https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings).\n\n## License\n\nvscode-apple-swift-format is available under the [MIT](./LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvknabel%2Fvscode-apple-swift-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvknabel%2Fvscode-apple-swift-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvknabel%2Fvscode-apple-swift-format/lists"}