[!NOTE]
Failure to specify --relative-results will result in a usage error being thrown instructing the user to use --relative-results. GitHub Actions specifically wants relative paths.
When used in CI, we get results directly on pull requests.
New class and methods:
Sources/PeripheryKit/Formatters/ActionsFormatter.swift: Introduced a new ActionsFormatter class with a format method to format scan results. This class requires the relativeResults configuration to be set, otherwise, it throws a PeripheryError.usageError.
This pull request adds a formatter for use with GitHub Actions.
The output of this formatter is meant to work as an actions annotation, as per the Actions Docs.
For example, if I had a file within my
Utilities
module that had an unused function, it would be output this way:Usage
When used in CI, we get results directly on pull requests.
New class and methods:
Sources/PeripheryKit/Formatters/ActionsFormatter.swift
: Introduced a newActionsFormatter
class with aformat
method to format scan results. This class requires therelativeResults
configuration to be set, otherwise, it throws aPeripheryError.usageError
.Enum extension:
Sources/Shared/OutputFormat.swift
: Extended theOutputFormat
enum to include a new caseactions
.Sources/PeripheryKit/Formatters/OutputFormatter.swift
: Updated theOutputFormat
extension to returnActionsFormatter.self
when theactions
case is selected.