config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package config contains helpers, defaults for linter

Index

Constants

View Source
const (
	// DefaultFile represent default config file name
	DefaultFile = "commitlint.yaml"
)

Variables

This section is empty.

Functions

func GetConfig

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

GetConfig gets the config according to precedence if needed parses config file and returns config instance

func GetDefaultConf added in v0.5.0

func GetDefaultConf(onlyEnabled bool) *lint.Config

GetDefaultConf writes default config to given file

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 GetLinter

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

GetLinter returns Linter for given confFilePath

func Parse

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

Parse parse Config from given file

func RegisterFormatter added in v0.4.0

func RegisterFormatter(format lint.Formatter) error

RegisterFormatter registers a custom formatter if formatter already exists, returns error

func RegisterRule added in v0.4.0

func RegisterRule(rule lint.Rule) error

RegisterRule registers a custom rule if rule already exists, returns error

func Validate

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

Validate validates given config

func WriteConfToFile

func WriteConfToFile(outFilePath string, conf *lint.Config) (retErr error)

WriteConfToFile util func to write config object to given file

Types

This section is empty.

Jump to

Keyboard shortcuts

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