config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const VersionDev = "<dev>"

Variables

View Source
var Av = struct {
	PullRequest             PullRequest
	GitHub                  GitHub
	Aviator                 Aviator
	AdditionalTrunkBranches []string
	Remote                  string
}{
	Aviator: Aviator{
		APIHost: "https://api.aviator.co",
	},
	PullRequest: PullRequest{
		OpenBrowser: true,
	},
	GitHub:                  GitHub{},
	AdditionalTrunkBranches: []string{},
	Remote:                  "",
}
View Source
var UserState struct {
	NotifiedStackSyncChange bool
}

UserState is per-user state that is saved to their XDG_STATE_HOME directory.

View Source
var Version = VersionDev

Version is the version of the av application. It is set automatically when creating release builds.

Functions

func FetchLatestVersion

func FetchLatestVersion() (string, error)

func Load

func Load(repoConfigDir string) error

Load initializes the configuration values.

This takes an optional repository config directory, which, when exists, overrides the default config.

func LoadUserState added in v0.0.36

func LoadUserState() error

LoadUserState loads the user state.

func SaveUserState added in v0.0.36

func SaveUserState() error

SaveUserState saves the user state.

Types

type Aviator added in v0.0.17

type Aviator struct {
	// The base URL of the Aviator API to use.
	// By default, this is https://aviator.co, but for on-prem installations
	// this can be changed (e.g., https://aviator.mycompany.com).
	// It should not include a trailing slash or any path components.
	APIHost string
	// The API token to use for authenticating to the Aviator API.
	APIToken string
}

type GitHub

type GitHub struct {
	// The GitHub API token to use for authenticating to the GitHub API.
	Token string
	// The base URL of the GitHub instance to use.
	// This should only be set for GitHub Enterprise Server (GHES) instances.
	// For example, "https://github.mycompany.com/" (without a "/api/v3" or
	// "/api/graphql" suffix).
	BaseURL string
}

type PullRequest added in v0.0.3

type PullRequest struct {
	Draft       bool
	OpenBrowser bool
	// If true, the pull request will be converted to a draft if the base branch
	// needs to be changed after the pull request has been changed. This avoids
	// accidentally adding lots of unnecessary auto-added reviewers (via GitHub's
	// CODEOWNERS feature) to the pull request while the PR is in a transient
	// state.
	// If not set, the value should be considered true iff there is a CODEOWNERS
	// file in the repository.
	RebaseWithDraft *bool

	// By default, when the pull request title contains "WIP", it automatically sets the PR as
	// a draft PR. Setting this to true suppresses this behavior.
	NoWIPDetection bool

	// Branch prefix to use for creating new branches.
	BranchNamePrefix string

	// If true, the CLI will automatically add/update a comment to all PRs linking other PRs in the stack.
	// False by default, since Aviator's MergeQueue also adds a similar comment.
	WriteStack bool
}

Jump to

Keyboard shortcuts

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