mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Updating reason message
This commit is contained in:
@@ -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)")])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user