Documentation
¶
Overview ¶
Package issue provides types to describe issues in linting reports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Issue ¶
type Issue struct {
// contains filtered or unexported fields
}
Issue represents a linting issue with a message and a type.
It is used to encapsulate the details of an issue found during the linting process. The Issue struct contains a message that describes the issue and a type that indicates its severity.
func NewCritical ¶
NewCritical creates a new Issue with type Critical.
It is a convenience function to create a critical issue. This function is used to create issues that indicate critical problems that need to be solved immediately.
func NewInfo ¶
NewInfo creates a new Issue with type Info.
It is a convenience function to create an informational issue. This function is used to create issues that provide additional information that does not require immediate action.
func NewWarning ¶
NewWarning creates a new Issue with type Warning.
It is a convenience function to create a warning issue. This function is used to create issues that indicate potential problems that should be reviewed but are not critical.
type Type ¶
type Type int8
Type represents the severity of an issue in the linting process and is used to categorize issues found during linting.
It indicates the severity of the issue (critical, warning, info), allowing the linting process to handle different types of issues appropriately.
const ( // Critical indicates a critical issue that needs to be solved immediately. // // It is used to represent issues that prevent the application from functioning correctly. // This type of issue should be addressed as a priority. // It is typically used for issues that indicate a failure in the linting process // or a violation of essential rules that must be corrected. Critical Type = 1 // Warning indicates a potential issue that should be reviewed but is not critical. // // It is used to represent issues that may not prevent the application from functioning, // but could lead to problems if not addressed. // This type of issue is typically used for linting rules that are not strictly enforced // but are recommended for best practices. Warning Type = 2 // Info indicates informational messages that do not require action. // // It is used to provide additional context or information about the linting process. // This type of issue is typically used for messages that provide insights // or details about the linting process, such as configuration settings or // general information that may be useful for the user but does not indicate a problem. Info Type = 3 )
func Parse ¶
Parse parses the provided string into an issue type.
Returns unspecifed one for empty input and unknown one for unknown strings. Note that these types are represented as predicates and cannot be declared as package constants to prevent its usage.
func (Type) Unspecified ¶
Unspecified defines whether the type is unspecified.