rules

package
v0.6.16 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package rules contains implementations of checker rules.

Rules are sorted into groups. Every rule represented in code here must be documented in English in a corresponding registry rule. Conversely, anything mandated in such a rule should have a rule here if it is feasible to enforce in code (sometimes it is infeasible, however).

A rule is technically anything with a `GetName()` and `Apply(Resource)` but most rule authors will want to use the rule structs provided in the lint package (`lint.ProjectRule`, lint.FieldRule`, and so on). These run against each applicable registry resource type or field. They also have an `OnlyIf` property that can be used to run against a subset of resources.

Once a rule is written, it needs to be registered. This involves adding the rule to the `AddRules` method for the appropriate group. If this is the first rule for a new package, then the `rules.go` init() function must also be updated to run the `Add` function for the new package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(r lint.RuleRegistry) error

Add all rules to the given registry.

Types

This section is empty.

Directories

Path Synopsis
Api availability field is free-form, but we expect single words that describe availability.
Api availability field is free-form, but we expect single words that describe availability.
if label name is the same as a Taxonomy name, its value must match one of the Taxonomy's Element's ID
if label name is the same as a Taxonomy name, its value must match one of the Taxonomy's Element's ID
APIVersion state must match a valid lifecycle stage
APIVersion state must match a valid lifecycle stage
Api recommended_version must be an ApiVersion that is a child of this Api.
Api recommended_version must be an ApiVersion that is a child of this Api.
Api recommended_version must be an ApiVersion that is a child of this Api.
Api recommended_version must be an ApiVersion that is a child of this Api.
Api state field is free-form, but we expect single words that describe state.
Api state field is free-form, but we expect single words that describe state.
Api recommended_version must be an ApiVersion that is a child of this Api.
Api recommended_version must be an ApiVersion that is a child of this Api.
ApiDeployment api_spec_revision must be an SpecRevision and sibling under the parent Api.
ApiDeployment api_spec_revision must be an SpecRevision and sibling under the parent Api.
max length of 5k, all characters must use UTF-8 encoding
max length of 5k, all characters must use UTF-8 encoding
Each resource can have multiple labels, up to a maximum of 64.
Each resource can have multiple labels, up to a maximum of 64.
Each resource can have multiple annotations, up to a maximum total size of 256k.
Each resource can have multiple annotations, up to a maximum total size of 256k.

Jump to

Keyboard shortcuts

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