Skip to content

Commit 68bff4d

Browse files
authored
Merge pull request #484 from swiftwasm/maxd/toolchain-swift-format
Use `swift format` command provided by the Swift toolchain
2 parents 721f662 + d5399eb commit 68bff4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Utilities/format.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func which(_ executable: String) -> URL? {
3838

3939
/// Runs the `swift-format` command with the given arguments in the project root.
4040
func swiftFormat(_ arguments: [String]) throws {
41-
guard let swiftFormat = which("swift-format") else {
41+
guard let swiftFormat = which("swift") else {
4242
print("swift-format not found in PATH")
4343
exit(1)
4444
}
@@ -93,7 +93,7 @@ switch arguments.first {
9393
case "lint":
9494
try swiftFormat(["lint", "--parallel", "--recursive"] + filesToFormat())
9595
case "format", nil:
96-
try swiftFormat(["format", "--parallel", "--in-place", "--recursive"] + filesToFormat())
96+
try swiftFormat(["format", "format", "--parallel", "--in-place", "--recursive"] + filesToFormat())
9797
case let subcommand?:
9898
print("Unknown subcommand: \(subcommand)")
9999
print("Usage: format.swift lint|format")

0 commit comments

Comments
 (0)