Files
SwiftLint/Source/SwiftLintBuiltInRules/Rules/Metrics/FunctionBodyLengthRule.swift
Danny Mösch 40bd97038a Support arbitrary configurations in @SwiftSyntaxRule (#5275)
Almost all rules based on SwiftSyntax can be set up now by just adding
`@SwiftSyntaxRule` to the rule struct.
2023-10-16 19:34:43 +02:00

15 lines
549 B
Swift

struct FunctionBodyLengthRule: SwiftSyntaxRule {
var configuration = SeverityLevelsConfiguration<Self>(warning: 50, error: 100)
static let description = RuleDescription(
identifier: "function_body_length",
name: "Function Body Length",
description: "Function bodies should not span too many lines",
kind: .metrics
)
func makeVisitor(file: SwiftLintFile) -> ViolationsSyntaxVisitor<ConfigurationType> {
BodyLengthRuleVisitor(kind: .function, file: file, configuration: configuration)
}
}