scope

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package scope resolves the --commit-scope flag value into the absolute repo path that an audit record should be bound to. The trailer-emitting

Index

Constants

This section is empty.

Variables

View Source
var ErrNotInRepo = errors.New("scope: cwd is not inside a git repo; pass --commit-scope=<repo-path> explicitly")

ErrNotInRepo is returned when --commit-scope=auto is requested but cwd is not inside a git repo. Caller is expected to pass --commit-scope

View Source
var ErrOptOutRejected = errors.New("scope: --commit-scope opt-out is not supported; pass an explicit repo path")

ErrOptOutRejected is returned when the caller passes a value meant to disable binding ("-", "none", "off"). The opt-out hatch was removed -

Functions

func CWD

func CWD() string

CWD returns the current working directory or empty on error. Convenience wrapper so callers can do scope.Resolve(flag, env, scope.CWD()) without

func Resolve

func Resolve(flagValue, envFallback, cwd string) (string, error)

Resolve interprets a --commit-scope flag value:

  • "auto" (case-insensitive): git toplevel of cwd, or ErrNotInRepo.

Types

This section is empty.

Jump to

Keyboard shortcuts

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