rule

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HasApply

type HasApply interface {
	// Apply applies the rule to the proto.
	Apply(proto *parser.Proto) ([]report.Failure, error)
}

HasApply represents a rule which can be applied.

type HasID

type HasID interface {
	// ID returns the ID of this rule. This should be all UPPER_SNAKE_CASE.
	ID() string
}

HasID represents a rule with ID.

type HasIsOfficial

type HasIsOfficial interface {
	// IsOfficial decides whether or not this rule belongs to the official guide.
	IsOfficial() bool
}

HasIsOfficial represents a rule with IsOfficial.

type HasPurpose

type HasPurpose interface {
	// Purpose returns the purpose of this rule. This should be a human-readable string.
	Purpose() string
}

HasPurpose represents a rule with Purpose.

type HasSeverity added in v0.45.0

type HasSeverity interface {
	// Severity returns the selected severity of a rule
	Severity() Severity
}

HasSeverity represents a rule with a configurable severity

type Rule

Rule represents a rule which a linter can apply.

type Severity added in v0.45.0

type Severity string

Severity represents the severity of the rule. All failues will have this severity on export.

const (
	// SeverityNote represents a note only rule severity
	SeverityNote Severity = "note"
	// SeverityWarning represents a rule severity at a warning level
	SeverityWarning Severity = "warning"
	// SeverityError represents a rule severity at a warning level
	SeverityError Severity = "error"
)

Jump to

Keyboard shortcuts

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