config

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package config contains helpers, defaults for linter

Index

Constants

View Source
const (
	DefaultTypeCharset  = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	DefaultScopeCharset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/,"
)

Variables

This section is empty.

Functions

func DefaultIgnorePatterns added in v0.11.0

func DefaultIgnorePatterns() []string

DefaultIgnorePatterns returns the default list of ignore patterns These patterns match commit messages auto-generated by git commands like merge, revert, fixup, squash, etc.

func DefaultTypeEnums added in v0.11.0

func DefaultTypeEnums() []interface{}

DefaultTypeEnums returns the default list of type enums

func GetEnabledRules added in v0.4.0

func GetEnabledRules(conf *lint.Config) ([]lint.Rule, error)

GetEnabledRules forms Rule object for rules which are enabled in config

func GetFormatter

func GetFormatter(conf *lint.Config) (lint.Formatter, error)

GetFormatter returns the formatter as defined in conf

func LookupAndParse added in v0.8.0

func LookupAndParse() (*lint.Config, error)

LookupAndParse gets the config path according to the precedence if exists, parses the config file and returns config instance

func NewDefault added in v0.8.0

func NewDefault() *lint.Config

NewDefault returns default config

func NewLinter added in v0.8.0

func NewLinter(conf *lint.Config) (*lint.Linter, error)

NewLinter returns Linter for given confFilePath

func Parse

func Parse(confPath string) (*lint.Config, error)

Parse parse given file in confPath, and return Config instance, error if any

func Validate

func Validate(conf *lint.Config) []error

Validate validates given config instance, it checks the following If formatters, rules are registered/known If arguments to rules are valid If version is valid and at least minimum than commitlint version used

func WriteCompactTo added in v0.11.0

func WriteCompactTo(w io.Writer, conf *lint.Config) error

WriteCompactTo writes config in yaml format to given io.Writer. Only settings for enabled rules are written, keeping the output compact.

func WriteTo added in v0.8.0

func WriteTo(w io.Writer, conf *lint.Config) (retErr error)

WriteTo writes config in yaml format to given io.Writer, including all settings and every field even if empty or zero-valued.

Types

This section is empty.

Jump to

Keyboard shortcuts

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