audit

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package audit is the f10 audit command: the map an audit partitions and briefs its reviewers from, churn, tasks and pain per area over a range.

Index

Constants

View Source
const AllCommits = 300

AllCommits is how far back `all` reads, because the full history would crowd out the code.

View Source
const NoLedger = "No ledger history for this range."

NoLedger is the pain block when the ledger holds nothing for the range.

Variables

This section is empty.

Functions

func Area

func Area(file string) string

Area is a file's parent directory, the partition churn sums by.

func Command

func Command() *cli.Command

Command is the audit noun.

Types

type Churn

type Churn struct {
	Dir     string `json:"dir"`
	Added   int    `json:"added"`
	Deleted int    `json:"deleted"`
	Commits int    `json:"commits"`
}

Churn is one area's lines over the range.

type Commit

type Commit struct {
	SHA   string
	Task  string // "" for upkeep
	At    time.Time
	Files []FileStat
}

Commit is one commit of the range, with the task it maps to.

func Commits

func Commits(ctx context.Context, dir, prefix, rng string) ([]Commit, error)

Commits reads the range in one git log: a commit's task is its Task: or Change: trailer, else what regression.CommitTask finds, so audit, history and attribution agree on which task owns a commit.

type FileStat

type FileStat struct {
	Path           string
	Added, Deleted int
}

FileStat is one file's numstat line.

type Map

type Map struct {
	Range  string    `json:"range"`
	Churn  []Churn   `json:"churn"`
	Tasks  []Task    `json:"tasks"`
	Upkeep []string  `json:"upkeep"` // commits naming no task
	Pain   *pain.Map `json:"pain"`
	Ledger bool      `json:"ledger"` // the ledger held rows for the range's tasks
}

Map is what the command prints.

func Build

func Build(rng string, commits []Commit) *Map

Build is the churn and the task map; the pain map is added by the caller, which reads the ledger.

func (*Map) Write

func (m *Map) Write(w io.Writer) error

Write is the text form: churn, tasks, upkeep, then the pain map.

type Task

type Task struct {
	ID      string   `json:"id"`
	Commits []string `json:"commits"`
	Areas   []string `json:"areas"`
}

Task is one task of the range: its commits and the areas they touched.

Jump to

Keyboard shortcuts

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