Updating reason message

This commit is contained in:
Marcelo Fabri
2016-01-14 20:47:17 -08:00
parent 579872cd30
commit 12eb3fece7
2 changed files with 8 additions and 4 deletions
@@ -86,7 +86,8 @@ public struct FunctionBodyLengthRule: ASTRule, ViolationLevelRule {
severity: parameter.severity,
location: location,
reason: "Function body should span \(parameter.value) lines " +
"or less: currently spans \(lineCount) lines")]
"or less: currently spans \(lineCount) lines (already ignoring " +
"comment and whitespace only ones)")]
}
}
@@ -24,7 +24,8 @@ class FunctionBodyLengthRuleTests: XCTestCase {
XCTAssertEqual(violations(longerFunctionBody), [StyleViolation(
ruleDescription: FunctionBodyLengthRule.description,
location: Location(file: nil, line: 1, character: 1),
reason: "Function body should span 40 lines or less: currently spans 41 lines")])
reason: "Function body should span 40 lines or less: currently spans 41 lines " +
"(already ignoring comment and whitespace only ones)")])
let longerFunctionBodyWithEmptyLines = "func abc() {" +
Repeat(count: 100, repeatedValue: "\n").joinWithSeparator("") +
@@ -48,7 +49,8 @@ class FunctionBodyLengthRuleTests: XCTestCase {
XCTAssertEqual(violations(longerFunctionBodyWithComments), [StyleViolation(
ruleDescription: FunctionBodyLengthRule.description,
location: Location(file: nil, line: 1, character: 1),
reason: "Function body should span 40 lines or less: currently spans 41 lines")])
reason: "Function body should span 40 lines or less: currently spans 41 lines " +
"(already ignoring comment and whitespace only ones)")])
}
func testFunctionBodyLengthsWithMultilineComments() {
@@ -67,6 +69,7 @@ class FunctionBodyLengthRuleTests: XCTestCase {
XCTAssertEqual(violations(longerFunctionBodyWithMultilineComments), [StyleViolation(
ruleDescription: FunctionBodyLengthRule.description,
location: Location(file: nil, line: 1, character: 1),
reason: "Function body should span 40 lines or less: currently spans 41 lines")])
reason: "Function body should span 40 lines or less: currently spans 41 lines " +
"(already ignoring comment and whitespace only ones)")])
}
}