rules

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BilingualRuleName = "bilingual"
	RuSuffix          = ".ru.md"
	RuFallbackSuffix  = "_ru.md"
)
View Source
const (
	ChangelogRuleName = "changelog"
)
View Source
const (
	CyrillicInEnglishRuleName = "cyrillic-in-english"
)
View Source
const FrontMatterRuleName = "front-matter"
View Source
const (
	MarkdownlintRuleName = "markdownlint"
)
View Source
const (
	NoLangKeyRuleName = "no-lang-key"
)
View Source
const (
	ReadmeRuleName = "readme"
)
View Source
const (
	SizeRuleName = "size"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BilingualRule

type BilingualRule struct {
	pkg.RuleMeta
	pkg.PathRule
	// contains filtered or unexported fields
}

func NewBilingualRule

func NewBilingualRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *BilingualRule

func (*BilingualRule) Check added in v0.2.0

func (r *BilingualRule) Check(_ context.Context)

type ChangelogRule added in v0.2.4

type ChangelogRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewChangelogRule added in v0.2.4

func NewChangelogRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *ChangelogRule

func (*ChangelogRule) Check added in v0.2.4

func (r *ChangelogRule) Check(_ context.Context)

type CyrillicInEnglishRule

type CyrillicInEnglishRule struct {
	pkg.RuleMeta
	pkg.PathRule
	// contains filtered or unexported fields
}

func NewCyrillicInEnglishRule

func NewCyrillicInEnglishRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *CyrillicInEnglishRule

func (*CyrillicInEnglishRule) Check added in v0.2.0

type FrontMatterRule added in v0.1.105

type FrontMatterRule struct {
	pkg.RuleMeta
	pkg.PathRule
	// contains filtered or unexported fields
}

func NewFrontMatterRule added in v0.1.105

func NewFrontMatterRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *FrontMatterRule

func (*FrontMatterRule) Check added in v0.2.0

func (r *FrontMatterRule) Check(_ context.Context)

Check validates the YAML front matter of markdown files under docs/.

Rationale: the documentation site is rendered (Hugo) from the module's docs/ tree, and a markdown file whose YAML front matter is malformed — an unterminated "---" block or invalid YAML between the delimiters — aborts that render. markdownlint does not parse front matter as YAML and no-lang-key only looks for a "lang:" key, so a broken front matter is caught nowhere at lint time and only surfaces later as an opaque site-build failure. This rule shifts that detection left: the broken file is reported here, with its path, before the module is released.

Scope mirrors the render: the whole docs/ tree is scanned recursively, except docs/internal/ which is not rendered (the same subtree the size rule excludes). Only files that actually begin with a "---" front matter delimiter are checked; a file without front matter has nothing to validate and is skipped.

type MarkdownRule added in v0.1.95

type MarkdownRule struct {
	pkg.RuleMeta
	pkg.PathRule
	// contains filtered or unexported fields
}

func NewMarkdownRule added in v0.1.95

func NewMarkdownRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *MarkdownRule

func (*MarkdownRule) Check added in v0.2.0

func (r *MarkdownRule) Check(ctx context.Context)

type NoLangKeyRule added in v0.1.73

type NoLangKeyRule struct {
	pkg.RuleMeta
	pkg.PathRule
	// contains filtered or unexported fields
}

func NewNoLangKeyRule added in v0.1.73

func NewNoLangKeyRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *NoLangKeyRule

func (*NoLangKeyRule) Check added in v0.2.0

func (r *NoLangKeyRule) Check(_ context.Context)

type ReadmeRule

type ReadmeRule struct {
	pkg.RuleMeta
	pkg.PathRule
	// contains filtered or unexported fields
}

func NewReadmeRule

func NewReadmeRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *ReadmeRule

func (*ReadmeRule) Check added in v0.2.0

func (r *ReadmeRule) Check(_ context.Context)

type SizeRule added in v0.1.100

type SizeRule struct {
	pkg.RuleMeta
	// contains filtered or unexported fields
}

func NewSizeRule added in v0.1.100

func NewSizeRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *SizeRule

func (*SizeRule) Check added in v0.2.0

func (r *SizeRule) Check(_ context.Context)

Check sums the size of the documentation files under the docs/ directory and reports an error when the total exceeds maxDocsSizeBytes. The docs/internal subtree is skipped on purpose: it holds content that is not rendered as documentation, so it must not count towards the limit. Every other subfolder is scanned recursively. Oversized docs bloat the module artifact and usually signal binary assets that don't belong there.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL