Repository navigation
Summary
rockbruno edited this page May 9, 2020
·
1 revision
A Summary is a wrapper struct that represents the result of comparing two instances of a provider.
public struct Summary: Codable, HashableCodable, Hashable
Creates a Summary.
public init(text: String, style: Style, numericValue: Float, stringValue: String)- text: The description of this summary.
- style: The sentimental result of this summary. See
Summary.Stylefor more information. - numericValue: The numeric value that represents this summary, to be used in tools like SwiftInfo-Reader. For example, if a build increased the number of tests by 3,
numericValueshould be 3. - stringValue: The string value that represents this summary. For example, if a build increased the number of tests by 3,
stringValuecan be either 3 or 'Three'. This is used only for visual purposes.
The descriptive result of this summary.
let text: StringA hex value that represents the result of this summary.
let color: StringThe numeric value that represents this summary, to be used in tools like SwiftInfo-Reader.
let numericValue: FloatThe string value that represents this summary, to be used in tools like SwiftInfo-Reader.
let stringValue: Stringvar slackDictionary: [String: Any]Creates a basic Summary that differs depending if a provider's value increased, decreased or stayed the same.
Here's an example:
Build Time: Increased by 3 (100 seconds)
public static func genericFor<T: BinaryInteger & SignedNumeric>(prefix: String, now: T, old: T?, increaseIsBad: Bool, stringValueFormatter: ((T) -> String)? = nil, numericValueFormatter: ((T) -> Float)? = nil, difference: ((T, T) -> T)? = nil) -> Summary- prefix: The prefix of the message. Ideally, this should be the description of your provider.
- now: The current numeric value of the provider.
- old: The previous numeric value of the provider.
- increaseIsBad: If set to true, increases in value will use the
.negativeSummary.Style. - stringValueFormatter: (Optional) The closure that translates the numeric value to a visual string. By default, the behavior is to simply cast the number to a String.
- numericValueFormatter: (Optional) The closure that translates the numeric value to a Float. Float is the type used by reader tools like SwiftInfo-Reader, and by default, the behavior is to simply convert the number to a Float.
- difference: (Optional) The closure that shows how to calculate the numerical difference between the providers. The first argument is the new value, and the second is the old one. By default, this closure is { abs(old - new) }.
Generated at 2020-05-09T11:06:54+0000 using swift-doc 1.0.0-beta.2.
Types
- ArchiveDurationProvider
- ArchiveDurationProvider.Args
- BuildSystem
- CodeCoverageProvider
- CodeCoverageProvider.Args
- DLError
- DLHandle
- DLOpenFlags
- FileOpener
- FileUtils
- HTTPClient
- IPASizeProvider
- IPASizeProvider.Args
- LargestAssetCatalogProvider
- LargestAssetCatalogProvider.Args
- LargestAssetProvider
- LargestAssetProvider.Args
- LinesOfCodeProvider
- LinesOfCodeProvider.Args
- LongestTestDurationProvider
- LongestTestDurationProvider.Args
- Main
- OBJCFileCountProvider
- OBJCFileCountProvider.Args
- Output
- ProjectInfo
- Runner
- SKRequestDictionary
- SKResponse
- SKResponseDictionary
- SKResult
- SlackFormatter
- SourceKit
- Summary
- Summary.Style
- SwiftInfo
- SwiftInfoError
- TargetCountProvider
- TargetCountProvider.Args
- TargetCountProvider.Args.Mode
- TestCountProvider
- TestCountProvider.Args
- TotalAssetCatalogsSizeProvider
- TotalAssetCatalogsSizeProvider.Args
- TotalTestDurationProvider
- TotalTestDurationProvider.Args
- WarningCountProvider
- WarningCountProvider.Args
- XcodeprojPlistExtractor
- sourcekitd_keys
- sourcekitd_requests
- sourcekitd_values