[Lint] Remove trailing whitespace on empty lines

This commit is contained in:
Matt Rubin 2018-09-21 01:18:19 -04:00
parent 17ff9cf4f5
commit cedeccf6f7

View File

@ -685,43 +685,43 @@ class RepositorySpec: QuickSpec {
expect(commitMessages).to(equal(expectedMessages)) expect(commitMessages).to(equal(expectedMessages))
} }
} }
describe("Repository.add") { describe("Repository.add") {
it("Should add the modification under a path") { it("Should add the modification under a path") {
let repo = Fixtures.simpleRepository let repo = Fixtures.simpleRepository
let branch = repo.localBranch(named: "master").value! let branch = repo.localBranch(named: "master").value!
expect(repo.checkout(branch, strategy: CheckoutStrategy.None).error).to(beNil()) expect(repo.checkout(branch, strategy: CheckoutStrategy.None).error).to(beNil())
// make a change to README // make a change to README
let readmeURL = repo.directoryURL!.appendingPathComponent("README.md") let readmeURL = repo.directoryURL!.appendingPathComponent("README.md")
let readmeData = try! Data(contentsOf: readmeURL) let readmeData = try! Data(contentsOf: readmeURL)
defer { try! readmeData.write(to: readmeURL) } defer { try! readmeData.write(to: readmeURL) }
try! "different".data(using: .utf8)?.write(to: readmeURL) try! "different".data(using: .utf8)?.write(to: readmeURL)
let status = repo.status() let status = repo.status()
expect(status.value?.count).to(equal(1)) expect(status.value?.count).to(equal(1))
expect(status.value!.first!.status).to(equal(.workTreeModified)) expect(status.value!.first!.status).to(equal(.workTreeModified))
expect(repo.add(path: "README.md").error).to(beNil()) expect(repo.add(path: "README.md").error).to(beNil())
let newStatus = repo.status() let newStatus = repo.status()
expect(newStatus.value?.count).to(equal(1)) expect(newStatus.value?.count).to(equal(1))
expect(newStatus.value!.first!.status).to(equal(.indexModified)) expect(newStatus.value!.first!.status).to(equal(.indexModified))
} }
it("Should add an untracked file under a path") { it("Should add an untracked file under a path") {
let repo = Fixtures.simpleRepository let repo = Fixtures.simpleRepository
let branch = repo.localBranch(named: "master").value! let branch = repo.localBranch(named: "master").value!
expect(repo.checkout(branch, strategy: CheckoutStrategy.None).error).to(beNil()) expect(repo.checkout(branch, strategy: CheckoutStrategy.None).error).to(beNil())
// make a change to README // make a change to README
let untrackedURL = repo.directoryURL!.appendingPathComponent("untracked") let untrackedURL = repo.directoryURL!.appendingPathComponent("untracked")
try! "different".data(using: .utf8)?.write(to: untrackedURL) try! "different".data(using: .utf8)?.write(to: untrackedURL)
defer { try! FileManager.default.removeItem(at: untrackedURL) } defer { try! FileManager.default.removeItem(at: untrackedURL) }
expect(repo.add(path: ".").error).to(beNil()) expect(repo.add(path: ".").error).to(beNil())
let newStatus = repo.status() let newStatus = repo.status()
expect(newStatus.value?.count).to(equal(1)) expect(newStatus.value?.count).to(equal(1))
expect(newStatus.value!.first!.status).to(equal(.indexNew)) expect(newStatus.value!.first!.status).to(equal(.indexNew))
@ -733,13 +733,13 @@ class RepositorySpec: QuickSpec {
let repo = Fixtures.simpleRepository let repo = Fixtures.simpleRepository
let branch = repo.localBranch(named: "master").value! let branch = repo.localBranch(named: "master").value!
expect(repo.checkout(branch, strategy: CheckoutStrategy.None).error).to(beNil()) expect(repo.checkout(branch, strategy: CheckoutStrategy.None).error).to(beNil())
// make a change to README // make a change to README
let untrackedURL = repo.directoryURL!.appendingPathComponent("untrackedtest") let untrackedURL = repo.directoryURL!.appendingPathComponent("untrackedtest")
try! "different".data(using: .utf8)?.write(to: untrackedURL) try! "different".data(using: .utf8)?.write(to: untrackedURL)
expect(repo.add(path: ".").error).to(beNil()) expect(repo.add(path: ".").error).to(beNil())
let signature = Signature( let signature = Signature(
name: "swiftgit2", name: "swiftgit2",
email: "foobar@example.com", email: "foobar@example.com",
@ -753,17 +753,17 @@ class RepositorySpec: QuickSpec {
expect(repo.commits(in: updatedBranch).next()?.value?.committer).to(equal(signature)) expect(repo.commits(in: updatedBranch).next()?.value?.committer).to(equal(signature))
expect(repo.commits(in: updatedBranch).next()?.value?.message).to(equal("\(message)\n")) expect(repo.commits(in: updatedBranch).next()?.value?.message).to(equal("\(message)\n"))
expect(repo.commits(in: updatedBranch).next()?.value?.oid.description).to(equal("7d6b2d7492f29aee48022387f96dbfe996d435fe")) expect(repo.commits(in: updatedBranch).next()?.value?.oid.description).to(equal("7d6b2d7492f29aee48022387f96dbfe996d435fe"))
// should be clean now // should be clean now
let newStatus = repo.status() let newStatus = repo.status()
expect(newStatus.value?.count).to(equal(0)) expect(newStatus.value?.count).to(equal(0))
} }
} }
describe("Repository.status") { describe("Repository.status") {
it("Should accurately report status for repositories with no status") { it("Should accurately report status for repositories with no status") {
let expectedCount = 0 let expectedCount = 0
let repo = Fixtures.mantleRepository let repo = Fixtures.mantleRepository
let branch = repo.localBranch(named: "master").value! let branch = repo.localBranch(named: "master").value!
expect(repo.checkout(branch, strategy: CheckoutStrategy.None).error).to(beNil()) expect(repo.checkout(branch, strategy: CheckoutStrategy.None).error).to(beNil())