Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeadingPattern ¶
HeadingPattern is a regex pattern matched against heading text with an associated maximum section length.
type Rule ¶
type Rule struct {
// Max is the default per-section line limit. Zero means no global limit.
Max int
// PerLevel overrides Max for a specific heading level (1-6).
PerLevel map[int]int
// PerHeading overrides Max and PerLevel when the heading text matches.
// The first pattern that matches wins.
PerHeading []HeadingPattern
}
Rule enforces per-section line-count limits.
Section length is the count of lines from the heading line up to (but not including) the next heading line of any level, or the end of file. Nested subsections are therefore measured separately from their parent.
func (*Rule) ApplySettings ¶
ApplySettings implements rule.Configurable.
func (*Rule) Check ¶
func (r *Rule) Check(f *lint.File) []lint.Diagnostic
Check implements rule.Rule.
func (*Rule) DefaultSettings ¶
DefaultSettings implements rule.Configurable. All keys are returned so re-applying defaults (e.g., test cleanup) fully clears PerLevel and PerHeading, not just Max.
func (*Rule) EnabledByDefault ¶
EnabledByDefault implements rule.Defaultable.