Skip to content

Commit

Permalink
Use SwiftPM to run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
yanamura committed Feb 11, 2020
1 parent e070977 commit 645de28
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
/.build
/Packages
/Tools/.build
/*.xcodeproj
swift-format/
4 changes: 2 additions & 2 deletions Captain.config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"pre-commit": [
"swift run --package-path swift-format swift-format -r Sources -i",
"swift run --package-path swift-format swift-format -r Tests -i",
"swift run --package-path Tools swift-format -r Sources -i",
"swift run --package-path Tools swift-format -r Tests -i",
"git add ."
]
}
1 change: 0 additions & 1 deletion Scripts/init.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
git clone [email protected]:apple/swift-format.git swift-format
swift run captain uninstall
swift run captain install
34 changes: 34 additions & 0 deletions Tools/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"object": {
"pins": [
{
"package": "swift-format",
"repositoryURL": "https://github.com/apple/swift-format",
"state": {
"branch": "master",
"revision": "0266e971d63a48148ab9d55bb4559dc23f974033",
"version": null
}
},
{
"package": "SwiftSyntax",
"repositoryURL": "https://github.com/apple/swift-syntax",
"state": {
"branch": "swift-DEVELOPMENT-SNAPSHOT-2020-01-29-a",
"revision": "16f6af54d9ad3cfcb35cd557288783dded1107fd",
"version": null
}
},
{
"package": "swift-tools-support-core",
"repositoryURL": "https://github.com/apple/swift-tools-support-core.git",
"state": {
"branch": null,
"revision": "693aba4c4c9dcc4767cc853a0dd38bf90ad8c258",
"version": "0.0.1"
}
}
]
},
"version": 1
}
9 changes: 9 additions & 0 deletions Tools/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// swift-tools-version:5.1
import PackageDescription

let package = Package(
name: "Tools",
dependencies: [
.package(url: "https://github.com/apple/swift-format", .branch("master"))
]
)

0 comments on commit 645de28

Please sign in to comment.