severity

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package severity orders loupe's four severity words so that every surface ranks findings the same way.

Index

Constants

This section is empty.

Variables

View Source
var Order = [...]string{"critical", "major", "minor", "trivial"}

Order is the four words a finding's severity may take, most severe first. It is the enum: validation, sorting and the terminal's color ramp all read it.

Functions

func Compare

func Compare(a, b string) int

Compare orders by Rank, for slices.SortFunc. Two unrated values compare equal, so the surface's own tie-break decides between them.

func Rank

func Rank(s string) int

Rank is a word's index in Order. Anything else — absent, empty, or the free text a run captured before the enum — ranks past every word, because severity is reviewer-reported and placing an unrated finding among the rated ones would invent the value the reviewer withheld.

func Rated

func Rated(s string) bool

Rated reports whether a stored value is one of the four words. A pre-enum free text is not, which is what the surfaces that interpolate the word raw, rather than inside a code span, check before they do.

Types

This section is empty.

Jump to

Keyboard shortcuts

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