Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singular/Plural Noun Fixes #104

Merged
merged 2 commits into from
Jul 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions BuildaKit/SyncPairResolver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,14 @@ public class SyncPairResolver {

let summary = passingIntegration.buildResultSummary!
if passingIntegration.result == .Succeeded {
lines.append(resultString + "**Perfect build!** All \(summary.testsCount) tests passed. :+1:")
let testsCount = summary.testsCount
lines.append(resultString + "**Perfect build!** All \(testsCount) " + "test".pluralizeStringIfNecessary(testsCount) + " passed. :+1:")
} else if passingIntegration.result == .Warnings {
lines.append(resultString + "All \(summary.testsCount) tests passed, but please **fix \(summary.warningCount) warnings**.")
let warningCount = summary.warningCount
lines.append(resultString + "All \(summary.testsCount) tests passed, but please **fix \(warningCount) " + "warning".pluralizeStringIfNecessary(warningCount) + "**.")
} else {
lines.append(resultString + "All \(summary.testsCount) tests passed, but please **fix \(summary.analyzerWarningCount) analyzer warnings**.")
let analyzerWarningCount = summary.analyzerWarningCount
lines.append(resultString + "All \(summary.testsCount) tests passed, but please **fix \(analyzerWarningCount) " + "analyzer warning".pluralizeStringIfNecessary(analyzerWarningCount) + "**.")
}

//and code coverage
Expand All @@ -302,7 +305,8 @@ public class SyncPairResolver {
var lines = HDGitHubXCBotSyncer.baseCommentLinesFromIntegration(testFailingIntegration)
let status = HDGitHubXCBotSyncer.createStatusFromState(.Failure, description: "Build failed tests!")
let summary = testFailingIntegration.buildResultSummary!
lines.append(resultString + "**Build failed \(summary.testFailureCount) tests** out of \(summary.testsCount)")
let testFailureCount = summary.testFailureCount
lines.append(resultString + "**Build failed \(testFailureCount) " + "test".pluralizeStringIfNecessary(testFailureCount) + "** out of \(summary.testsCount)")
return self.statusAndCommentFromLines(lines, status: status)
}

Expand All @@ -312,14 +316,9 @@ public class SyncPairResolver {
}).first {

var lines = HDGitHubXCBotSyncer.baseCommentLinesFromIntegration(erroredIntegration)
let errorCount: String
if let summary = erroredIntegration.buildResultSummary {
errorCount = "\(summary.errorCount)"
} else {
errorCount = "?"
}
let errorCount: Int = erroredIntegration.buildResultSummary?.errorCount ?? -1
let status = HDGitHubXCBotSyncer.createStatusFromState(.Error, description: "Build error!")
lines.append(resultString + "**\(errorCount) errors, failing state: \(erroredIntegration.result!.rawValue)**")
lines.append(resultString + "**\(errorCount)" + "error".pluralizeStringIfNecessary(errorCount) + ", failing state: \(erroredIntegration.result!.rawValue)**")
return self.statusAndCommentFromLines(lines, status: status)
}

Expand Down
Binary file modified Meta/comment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The default workflow is as follows:
-----------------------
- Builda can (and by default does) post a comment into the PR conversation when an integration finishes

![](https://raw.githubusercontent.com/czechboy0/Buildasaur/master/Meta/comment.png)
![](https://raw.githubusercontent.com/czechboy0/Buildasaur/gladiolus/Meta/comment.png)

- this can be controlled in the UI with the toggle named "Post Status Comments"

Expand Down