config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConfig

func FindConfig(path string) (*os.File, error)

func FindRegalDirectory

func FindRegalDirectory(path string) (*os.File, error)

FindRegalDirectory searches for a .regal directory first in the directory of path, and if not found, in the parent directory, and if not found, in the parent's parent directory, and so on.

Types

type Category

type Category map[string]Rule

type Config

type Config struct {
	Rules  map[string]Category `json:"rules"`
	Ignore Ignore              `json:"ignore"`
}

func FromMap

func FromMap(confMap map[string]any) (Config, error)

type ExtraAttributes

type ExtraAttributes map[string]any

type Ignore added in v0.5.0

type Ignore struct {
	Files []string `json:"files"`
}

type Rule

type Rule struct {
	Level  string
	Ignore Ignore `json:"ignore"`
	Extra  ExtraAttributes
}

func (Rule) MarshalJSON

func (rule Rule) MarshalJSON() ([]byte, error)

func (*Rule) UnmarshalJSON

func (rule *Rule) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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