severity

package
v1.3.163 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package severity defines severity levels for lint rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterExternalSeverities added in v1.3.123

func RegisterExternalSeverities(entries map[string]Level)

RegisterExternalSeverities adds severity entries from external analyzer packages. This allows packages like staticcheck to register their severity mappings without requiring manual entries in the rulesSeverity map.

Params:

  • entries: map of rule codes to severity levels

Types

type Level

type Level int

Level represents the severity level of a rule

const (
	// SeverityInfo recommendations and style
	SeverityInfo Level = iota
	// SeverityWarning maintainability issues
	SeverityWarning
	// SeverityError potential bugs and serious issues
	SeverityError
)

func GetSeverity

func GetSeverity(ruleCode string) (level Level)

GetSeverity returns the severity level of a rule.

Params:

  • ruleCode: rule code (e.g., "KTN-VAR-CAMEL")

Returns:

  • level: severity level

func (Level) ColorCode

func (l Level) ColorCode() (code string)

ColorCode returns the ANSI color code for a level.

Returns:

  • code: ANSI color code

func (Level) String

func (l Level) String() (text string)

String returns the text representation of the level.

Returns:

  • text: text representation

func (Level) Style added in v1.3.130

func (l Level) Style() (style lipgloss.Style)

Style returns the lipgloss style for this severity level. Use this instead of ColorCode() for lipgloss-based rendering.

Returns:

  • style: lipgloss style for the severity level

func (Level) Symbol

func (l Level) Symbol() (sym string)

Symbol returns the symbol associated with the level.

Returns:

  • sym: symbol

Jump to

Keyboard shortcuts

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