Documentation
¶
Index ¶
Constants ¶
const ( BilingualRuleName = "bilingual" RuSuffix = ".ru.md" RuFallbackSuffix = "_ru.md" )
const (
ChangelogRuleName = "changelog"
)
const (
CyrillicInEnglishRuleName = "cyrillic-in-english"
)
const FrontMatterRuleName = "front-matter"
const (
MarkdownlintRuleName = "markdownlint"
)
const (
NoLangKeyRuleName = "no-lang-key"
)
const (
ReadmeRuleName = "readme"
)
const (
SizeRuleName = "size"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BilingualRule ¶
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
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
func (r *CyrillicInEnglishRule) Check(_ context.Context)
type FrontMatterRule ¶ added in v0.1.105
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
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
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 ¶
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
func NewSizeRule ¶ added in v0.1.100
func NewSizeRule(m pkg.Module, errorList *errors.LintRuleErrorsList) *SizeRule
func (*SizeRule) Check ¶ added in v0.2.0
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.