config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package config contains helpers, defaults for linter

Index

Constants

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

Variables

This section is empty.

Functions

func DefaultConfToFile

func DefaultConfToFile(isOnlyEnabled bool) error

DefaultConfToFile writes default config to given file

func GetConfig

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

GetConfig returns conf

func GetConfigPath

func GetConfigPath(confFilePath string) (string, bool, error)

GetConfigPath returns config file path, follwing below

  1. check for conf in current directory
  2. check for conf flag
  3. load default conf

func GetFormatter

func GetFormatter(c *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 GetRules

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

GetRules forms Rule object for rules which are enabled in config

func Parse

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

Parse parse Config from given file

func Validate

func Validate(conf *lint.Config) error

Validate parses Config from given data

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