mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
There's no reason to expose these publicly and this will make it nicer to move to a new module outside of the core SwiftLint functionality.
17 lines
568 B
Swift
17 lines
568 B
Swift
struct FunctionBodyLengthRule: SwiftSyntaxRule, ConfigurationProviderRule {
|
|
var configuration = SeverityLevelsConfiguration(warning: 50, error: 100)
|
|
|
|
init() {}
|
|
|
|
static let description = RuleDescription(
|
|
identifier: "function_body_length",
|
|
name: "Function Body Length",
|
|
description: "Functions bodies should not span too many lines.",
|
|
kind: .metrics
|
|
)
|
|
|
|
func makeVisitor(file: SwiftLintFile) -> ViolationsSyntaxVisitor {
|
|
BodyLengthRuleVisitor(kind: .function, file: file, configuration: configuration)
|
|
}
|
|
}
|