diff --git a/CHANGELOG.md b/CHANGELOG.md index e5eeede6b..a2ca499ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ ##### Enhancements -- None. +- Added GitHub Actions output formatter. ##### Bug Fixes diff --git a/Sources/PeripheryKit/Formatters/ActionsFormatter.swift b/Sources/PeripheryKit/Formatters/GitHubActionsFormatter.swift similarity index 91% rename from Sources/PeripheryKit/Formatters/ActionsFormatter.swift rename to Sources/PeripheryKit/Formatters/GitHubActionsFormatter.swift index 420c293bb..3a8cf55e5 100644 --- a/Sources/PeripheryKit/Formatters/ActionsFormatter.swift +++ b/Sources/PeripheryKit/Formatters/GitHubActionsFormatter.swift @@ -2,7 +2,7 @@ import Foundation import Shared import SystemPackage -final class ActionsFormatter: OutputFormatter { +final class GitHubActionsFormatter: OutputFormatter { let configuration: Configuration lazy var currentFilePath: FilePath = { .current }() @@ -12,7 +12,7 @@ final class ActionsFormatter: OutputFormatter { func format(_ results: [ScanResult]) throws -> String { guard results.count > 0 else { return "" } - guard configuration.relativeResults else { throw PeripheryError.usageError("`periphery scan` must be ran with `--relative-results` when using the actions formatter")} + guard configuration.relativeResults else { throw PeripheryError.usageError("`periphery scan` must be ran with `--relative-results` when using the GitHub Actions formatter")} return results.flatMap { result in describe(result, colored: false).map { (location, description) in diff --git a/Sources/PeripheryKit/Formatters/OutputFormatter.swift b/Sources/PeripheryKit/Formatters/OutputFormatter.swift index a2b459033..231d3b022 100644 --- a/Sources/PeripheryKit/Formatters/OutputFormatter.swift +++ b/Sources/PeripheryKit/Formatters/OutputFormatter.swift @@ -105,8 +105,8 @@ public extension OutputFormat { return JsonFormatter.self case .checkstyle: return CheckstyleFormatter.self - case .actions: - return ActionsFormatter.self + case .githubActions: + return GitHubActionsFormatter.self } } } diff --git a/Sources/Shared/OutputFormat.swift b/Sources/Shared/OutputFormat.swift index 2f8ad5cb5..77b508216 100644 --- a/Sources/Shared/OutputFormat.swift +++ b/Sources/Shared/OutputFormat.swift @@ -6,7 +6,7 @@ public enum OutputFormat: String, CaseIterable { case json case checkstyle case codeclimate - case actions + case githubActions = "github-actions" public static let `default` = OutputFormat.xcode