Documentation
¶
Overview ¶
Package task provides a linter that validates the task identifier in a commit message against the configured pattern.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task represents a linter that validates the task identifier in a commit message against the configured pattern.
func NewTask ¶
NewTask creates a new Task linter with the provided commit message and lint configuration that defines the pattern used to validate the task identifier.
func (Task) Issues ¶
Issues returns a slice of issues describing any validation problems with the task identifier in the commit message.
It returns no issues when the configured task identifier pattern is empty. Otherwise it compiles the pattern into a regular expression and extracts the ticket from the message subject. If the pattern fails to compile, a critical issue is returned describing the compilation error. If no ticket matching the pattern is found in the subject, an issue is returned with the level from the configuration.
Only the subject line of the message is searched for a ticket; the body is never inspected.