Documentation
¶
Overview ¶
Package untrackedallowance decides which untracked worktree paths a committed-content result may tolerate without degrading (decision 0142).
Paths excluded by ignore rules never reach this package: Git status does not list them. A listed untracked path is allowed only when it is provably disjoint from the Go build that the result depends on; everything else still degrades. The allowed set is bound into the result as a count and digest.
Index ¶
- Constants
- func GoPackageDirectories(trackedPaths []string) map[string]struct{}
- func OverlapsGoBuild(untracked string, packageDirectories map[string]struct{}) bool
- func ParseStatus(raw []byte) (untracked, tracked []string, err error)
- func Partition(untracked []string, overlaps func(string) bool) ([]string, string)
- type Allowance
Constants ¶
const Rule = "corvint-untracked-allowance/1"
Rule names the disjointness rule and the digest domain.
Variables ¶
This section is empty.
Functions ¶
func GoPackageDirectories ¶
GoPackageDirectories returns the directory of every tracked `.go` path.
func OverlapsGoBuild ¶
OverlapsGoBuild reports whether an untracked path can change a Go build, test, or Git evaluation over the committed tree. It is conservative: an untracked directory entry, any `.go` file, any Go or Git control file, any `vendor` segment, and anything inside a tracked Go package directory (where `//go:embed` and `testdata` reach) all overlap. The control-name and `vendor` checks fold case: on a case-insensitive filesystem (e.g. macOS APFS) an untracked path whose basename or segment differs from the control name only in case is the same directory entry the Go toolchain and Git resolve, so refusing the allowance is the safe reading on every host, including a case-sensitive one where folding merely loses an allowance.
func ParseStatus ¶
ParseStatus splits `git status --porcelain=v1 -z` output into the untracked (`??`) paths and every other changed path, each sorted.