Files
SwiftLint/Source/SwiftLintBuiltInRules/Rules/Metrics/FunctionBodyLengthRule.swift
T
Danny MöschandGitHub 3f039f26d5 Connect configs with their referencing rules to have some context in error logging (#5017)
With the binding of configurations to their associated rule types
"unknown configuration" errors can be made more specific mentioning
also the rule's identifier in the printed message.
2023-05-19 20:58:24 +02:00

15 lines
557 B
Swift

struct FunctionBodyLengthRule: SwiftSyntaxRule, ConfigurationProviderRule {
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 {
BodyLengthRuleVisitor(kind: .function, file: file, configuration: configuration)
}
}