Documentation
¶
Index ¶
Constants ¶
const CrdsDir = "crds"
const DocRuYAMLRuleName = "doc-ru-yaml"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BilingualRule ¶ added in v0.1.71
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
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 ¶
func NewEnumRule ¶
func NewEnumRule(cfg *pkg.OpenAPILinterConfig, rootPath string) *EnumRule