rules

package
v0.1.105 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const CrdsDir = "crds"
View Source
const DocRuYAMLRuleName = "doc-ru-yaml"

Variables

This section is empty.

Functions

This section is empty.

Types

type BilingualRule added in v0.1.71

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

func NewBilingualRule added in v0.1.71

func NewBilingualRule(_ *pkg.OpenAPILinterConfig, rootPath string) *BilingualRule

func (*BilingualRule) Run added in v0.1.71

func (r *BilingualRule) Run(path string, errorList *errors.LintRuleErrorsList)

Run checks that the given resource file has a corresponding doc-ru- translation file.

type DeckhouseCRDsRule

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

func NewDeckhouseCRDsRule

func NewDeckhouseCRDsRule(cfg *pkg.OpenAPILinterConfig, rootPath string) *DeckhouseCRDsRule

func (*DeckhouseCRDsRule) Run

func (r *DeckhouseCRDsRule) Run(moduleName, path string, errorList *errors.LintRuleErrorsList)

type DocRuYAMLRule added in v0.1.105

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

func NewDocRuYAMLRule added in v0.1.105

func NewDocRuYAMLRule(_ *pkg.OpenAPILinterConfig, rootPath string) *DocRuYAMLRule

func (*DocRuYAMLRule) Run added in v0.1.105

func (r *DocRuYAMLRule) Run(path string, errorList *errors.LintRuleErrorsList)

Run parses a doc-ru- translation file to verify it is syntactically valid YAML.

Rationale: doc-ru- files are documentation-only and are explicitly excluded from the enum/ha/keys/deckhouse-crds parsing, so their YAML syntax is checked nowhere else. A broken doc-ru- file therefore slips through module linting and only surfaces later, when the documentation site is built from the released module, as an opaque build failure. This rule shifts that detection left: a syntactically broken translation file is reported here, with its path, before the module is released.

The file is decoded as a YAML mapping, exactly like the base file's parser (internal/openapi getFileYAMLContent): a syntactically broken file — or one that is valid YAML but not a mapping, e.g. a bare scalar or a sequence between the delimiters — is reported. Deeper structural/semantic expectations still belong to the base file's own rules.

type EnumRule

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

func NewEnumRule

func NewEnumRule(cfg *pkg.OpenAPILinterConfig, rootPath string) *EnumRule

func (*EnumRule) Run

func (e *EnumRule) Run(path string, errorList *errors.LintRuleErrorsList)

type HARule

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

func NewHARule

func NewHARule(cfg *pkg.OpenAPILinterConfig, rootPath string) *HARule

func (*HARule) Run

func (e *HARule) Run(path string, errorList *errors.LintRuleErrorsList)

type KeysRule

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

func NewKeysRule

func NewKeysRule(cfg *pkg.OpenAPILinterConfig, rootPath string) *KeysRule

func (*KeysRule) Run

func (e *KeysRule) Run(path string, errorList *errors.LintRuleErrorsList)

Jump to

Keyboard shortcuts

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