Skip to content

Commit

Permalink
Changing reason message
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelofabri committed Jan 15, 2016
1 parent 12eb3fe commit 75a4f2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Source/SwiftLintFramework/Rules/FunctionBodyLengthRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public struct FunctionBodyLengthRule: ASTRule, ViolationLevelRule {
return [StyleViolation(ruleDescription: self.dynamicType.description,
severity: parameter.severity,
location: location,
reason: "Function body should span \(parameter.value) lines " +
"or less: currently spans \(lineCount) lines (already ignoring " +
"comment and whitespace only ones)")]
reason: "Function body should span \(parameter.value) lines or less " +
"excluding comments and whitespace: currently spans \(lineCount) " +
"lines")]
}

}
Expand Down
12 changes: 6 additions & 6 deletions Source/SwiftLintFrameworkTests/FunctionBodyLengthRuleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +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 " +
"(already ignoring comment and whitespace only ones)")])
reason: "Function body should span 40 lines or less excluding comments and " +
"whitespace: currently spans 41 lines")])

let longerFunctionBodyWithEmptyLines = "func abc() {" +
Repeat(count: 100, repeatedValue: "\n").joinWithSeparator("") +
Expand All @@ -49,8 +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 " +
"(already ignoring comment and whitespace only ones)")])
reason: "Function body should span 40 lines or less excluding comments and " +
"whitespace: currently spans 41 lines")])
}

func testFunctionBodyLengthsWithMultilineComments() {
Expand All @@ -69,7 +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 " +
"(already ignoring comment and whitespace only ones)")])
reason: "Function body should span 40 lines or less excluding comments and " +
"whitespace: currently spans 41 lines")])
}
}

0 comments on commit 75a4f2f

Please sign in to comment.