config

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPrefixes = []huh.Option[string]{
		huh.NewOption("feat - a new feature", "feat"),
		huh.NewOption("fix - a bug fix", "fix"),
		huh.NewOption("docs - documentation only changes", "docs"),
		huh.NewOption("style - changes that do not affect the meaning of the code", "style"),
		huh.NewOption("refactor - a code change that neither fixes a bug nor adds a feature", "refactor"),
		huh.NewOption("perf - a code change that improves performance", "perf"),
		huh.NewOption("test - adding missing tests or correcting existing tests", "test"),
		huh.NewOption("chore - changes to the build process or auxiliary tools and libraries", "chore"),
		huh.NewOption("revert - reverts a previous commit", "revert"),
		huh.NewOption("ci - changes to our CI configuration files and scripts", "ci"),
	}
)

Functions

func FindConfigFile

func FindConfigFile() (string, error)

FindConfigFile will find the config files based in the rules below: 1. If the current directory contains a .meteor.json file, it will be used. 2. If the current directory does not contain a .meteor.json file, the parent 3. IF parent doesn't contain the .meteor.json file, the search will continue until the home directory is reached. 4. If no .meteor.json file is found, look in ~/.config/meteor/config.json 5. If no .meteor.json file is found, return an error

Types

type Board

type Board struct {
	Name string `json:"name"`
}

type Boards

type Boards []Board

func (*Boards) Options

func (p *Boards) Options() []huh.Option[string]

type CoAuthor

type CoAuthor struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Selected bool
}

type CoAuthors

type CoAuthors []CoAuthor

func (*CoAuthors) Options

func (p *CoAuthors) Options() []huh.Option[string]

type Config

type Config struct {
	Prefixes  Prefixes  `json:"prefixes"`
	Coauthors CoAuthors `json:"coauthors"`
	Boards    Boards    `json:"boards"`
	ShowIntro *bool     `json:"showIntro"`
}

func New

func New() *Config

New returns a new Config

func (*Config) LoadFile

func (c *Config) LoadFile(filePath string) error

type Prefix

type Prefix struct {
	T string `json:"type"`
	D string `json:"description"`
}

type Prefixes

type Prefixes []Prefix

func (*Prefixes) Options

func (p *Prefixes) Options() []huh.Option[string]

Jump to

Keyboard shortcuts

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