config

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 14 Imported by: 1 module, 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 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 LintMessage added in v0.12.0

func LintMessage(commitMsg string) (*lint.Result, error)

LintMessage lints commitMsg using the default configuration. It is the simplest entry point for programmatic use: no config file is needed.

For custom configuration use Parse or NewDefault, then NewLinter.

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 conf using the default parser

func NewLinterWithParser added in v0.13.0

func NewLinterWithParser(conf *lint.Config, parser commit.Parser) (*lint.Linter, error)

NewLinterWithParser returns Linter for given conf and custom parser

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