Documentation
¶
Index ¶
Constants ¶
const AdvancedRuleID = "advanced"
AdvancedRuleID is the stable identifier used to reference this rule in diagnostics.
const BilingualRuleID = "bilingual"
BilingualRuleID is the stable identifier used to reference this rule in configuration.
const EnumRuleID = "enum"
EnumRuleID is the stable identifier used to reference this rule in configuration.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvancedRule ¶
type AdvancedRule struct {
// contains filtered or unexported fields
}
AdvancedRule checks that the settings schema carries the advanced marker at its top level only.
func NewAdvancedRule ¶
func NewAdvancedRule(packageDir string, collector *diag.Collector) *AdvancedRule
NewAdvancedRule constructs an AdvancedRule scoped to a package directory. The schema location inside it is fixed, so the rule resolves it from packageDir itself.
func (*AdvancedRule) Check ¶
func (r *AdvancedRule) Check(_ context.Context)
Check reports every schema below the top level that carries the advanced marker. The marker is optional: a schema that never sets it, and one that sets it on the root object or on its top-level settings, all satisfy the rule. An absent settings.yaml means the package exposes no settings, which is not this rule's concern.
type BilingualRule ¶ added in v0.33.7
type BilingualRule struct {
// contains filtered or unexported fields
}
BilingualRule checks that the schemas under openapi/ and their translations come in pairs.
func NewBilingualRule ¶ added in v0.33.7
func NewBilingualRule(packageDir string, collector *diag.Collector) *BilingualRule
NewBilingualRule constructs a BilingualRule scoped to a package directory. Which schemas it pairs up is fixed, so the rule resolves them from packageDir itself.
func (*BilingualRule) Check ¶ added in v0.33.7
func (r *BilingualRule) Check(_ context.Context)
Check reports a schema whose translation is missing and a translation whose schema is missing, the latter being how a misspelled translation surfaces. values.yaml is exempt: it describes the values computed for the templates rather than the settings a user writes, so it carries no user-facing descriptions to translate. So are the test fixtures, which hold values rather than a schema.
type EnumRule ¶ added in v0.33.7
type EnumRule struct {
// contains filtered or unexported fields
}
EnumRule checks that every enum value in a package's schemas is CamelCase.
func NewEnumRule ¶ added in v0.33.7
NewEnumRule constructs an EnumRule scoped to a package directory. Which schemas it reads is fixed, so the rule resolves them from packageDir itself.
func (*EnumRule) Check ¶ added in v0.33.7
Check reports every enum value of every schema that breaks the CamelCase convention. Translations are skipped because they carry descriptions rather than values, and so are test fixtures, which hold values rather than a schema.
Findings are warnings. The convention is what Kubernetes prescribes for its own API constants, but a package whose settings pass values straight through to an upstream configuration file cannot follow it without translating every value back in the template, so the rule advises rather than blocks.