Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-cfuller committed Feb 29, 2024
1 parent 81ad05b commit f3cc4cf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
34 changes: 13 additions & 21 deletions Plugins/SwiftLintPlugin/SwiftLintPlugin.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
//

Check failure on line 1 in Plugins/SwiftLintPlugin/SwiftLintPlugin.swift

View workflow job for this annotation

GitHub Actions / Swift

Header comments should be consistent with project patterns (file_header)
// All Contributions by Match Group
//
// Copyright © 2024 Tinder (Match Group, LLC)
//
// Licensed under the Match Group Modified 3-Clause BSD License.
// See https://github.com/Tinder/Layout/blob/main/LICENSE for license information.
//

import Foundation
import PackagePlugin
Expand All @@ -21,15 +16,9 @@ internal struct SwiftLintPlugin: BuildToolPlugin {
internal var description: String {
switch self {
case let .swiftFilesNotInProjectDirectory(directory):
return """
Swift files are not in project directory.
Directory: \(directory)
"""
return "Swift files are not in project directory '\(directory)'."
case let .swiftFilesNotInWorkingDirectory(directory):
return """
Swift files are not in working directory.
Directory: \(directory)
"""
return "Swift files are not in working directory '\(directory)'."
}
}
}
Expand Down Expand Up @@ -79,22 +68,29 @@ internal struct SwiftLintPlugin: BuildToolPlugin {
swiftFiles: [Path],
environment: [String: String],
pluginWorkDirectory path: Path
) -> [Command] {
) throws -> [Command] {

print("Environment:", environment)

guard !swiftFiles.isEmpty
else { return [] }

let arguments: [String] = ["lint", "--quiet", "--force-exclude", "--cache-path", "\(path)"]
let cachePath: Path = path.appending("Cache")
let outputPath: Path = path.appending("Output")

try [cachePath, outputPath]
.map(\.string)
.forEach { try FileManager.default.createDirectory(atPath: $0, withIntermediateDirectories: true) }

let arguments: [String] = ["lint", "--quiet", "--force-exclude", "--cache-path", "\(cachePath)"]

return [
.prebuildCommand(
displayName: "SwiftLint",
executable: executable.path,
arguments: arguments + swiftFiles.map(\.string),
environment: environment,
outputFilesDirectory: path.appending("Output"))
outputFilesDirectory: outputPath)
]
}
}
Expand Down Expand Up @@ -169,11 +165,7 @@ extension Path {
internal var description: String {
switch self {
case let .pathNotInDirectory(path, directory):
return """
Path is not in directory.
Path: \(path)
Directory: \(directory)
"""
return "Path '\(path)' is not in directory '\(directory)'."
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Tests/LayoutTests/UIKit/UIView+AutoLayoutTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ final class UIViewAutoLayoutTests: XCTestCase {

// MARK: - Safe Area

func testSageAreaConstraintsInset() {
func testSafeAreaConstraintsInset() {

// GIVEN

Expand All @@ -1011,7 +1011,7 @@ final class UIViewAutoLayoutTests: XCTestCase {
expect(constraints[3]).to(match(view.bottom.constraint(to: superview.safeArea.bottom)))
}

func testSageAreaConstraintsInset_givenInset() {
func testSafeAreaConstraintsInset_givenInset() {

// GIVEN

Expand All @@ -1033,7 +1033,7 @@ final class UIViewAutoLayoutTests: XCTestCase {
expect(constraints[3]).to(match(view.bottom.constraint(to: superview.safeArea.bottom, constant: -inset)))
}

func testSageAreaConstraintsInsetsDirectional() {
func testSafeAreaConstraintsInsetsDirectional() {

// GIVEN

Expand All @@ -1059,7 +1059,7 @@ final class UIViewAutoLayoutTests: XCTestCase {
.to(match(view.bottom.constraint(to: superview.safeArea.bottom, constant: -insets.bottom)))
}

func testSageAreaConstraintsInsetsCanonical() {
func testSafeAreaConstraintsInsetsCanonical() {

// GIVEN

Expand Down

0 comments on commit f3cc4cf

Please sign in to comment.