classify

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package classify assigns significance levels (skip/patch/minor/major) to commits based on diff analysis.

Index

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffInfo

type DiffInfo struct {
	ChangedFiles int
	Insertions   int
	Deletions    int
	Files        []string
	FileAnalysis FileAnalysis
}

type FileAnalysis

type FileAnalysis struct {
	APIFiles        int
	TestFiles       int
	DocFiles        int
	ConfigFiles     int
	MigrationFiles  int
	GeneratedFiles  int
	Lockfiles       int
	GenericFiles    int
	SecurityFiles   int
	PublicAPIFiles  int
	DeploymentFiles int
	HasMigrations   bool
	HasSecurity     bool
	HasPublicAPI    bool
	HasDeployment   bool
}

func AnalyzeFiles

func AnalyzeFiles(files []string) FileAnalysis

type FileCategory

type FileCategory int
const (
	FileCategoryGeneric FileCategory = iota
	FileCategoryAPI
	FileCategoryTest
	FileCategoryDocs
	FileCategoryConfig
	FileCategoryMigration
	FileCategoryGenerated
	FileCategoryLockfile
	FileCategorySecurity
	FileCategoryPublicAPI
	FileCategoryDeployment
)

type Level

type Level = significance.Level

type Result

type Result struct {
	Level   Level
	Reason  string
	Changed int
}

func Classify

func Classify(c commit.Commit, changedFiles int) Result

func ClassifyWithDiff

func ClassifyWithDiff(c commit.Commit, diff DiffInfo, th Thresholds) Result

func ClassifyWithThresholds

func ClassifyWithThresholds(c commit.Commit, changedFiles int, th Thresholds) Result

ClassifyWithThresholds determines the significance level of a commit. Classification is always recomputed from git data — it must never be cached, as git is the source of truth for commit metadata.

type Thresholds

type Thresholds struct {
	LargeFeatureFiles int
	LargeFixFiles     int
	LargeUnknownFiles int
}

func DefaultThresholds

func DefaultThresholds() Thresholds

Jump to

Keyboard shortcuts

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