diff

package
v0.2.22 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyzePatchSimple

func AnalyzePatchSimple(patch string) (meaningfulAdds, meaningfulDels int)

AnalyzePatchSimple returns just the meaningful additions and deletions

func IsCommentLine

func IsCommentLine(line string) bool

IsCommentLine checks if a line is a code comment (should not count as meaningful contribution)

func IsDocumentationFile

func IsDocumentationFile(filename string) bool

IsDocumentationFile checks if a file is documentation-only

func IsMeaningfulLine

func IsMeaningfulLine(line string) bool

IsMeaningfulLine checks if a line of code is meaningful (not a comment or whitespace)

func IsWhitespaceLine

func IsWhitespaceLine(line string) bool

IsWhitespaceLine checks if a line contains only whitespace characters

Types

type PatchStats

type PatchStats struct {
	TotalAdditions      int
	TotalDeletions      int
	MeaningfulAdditions int
	MeaningfulDeletions int
	CommentAdditions    int
	CommentDeletions    int
	WhitespaceAdditions int
	WhitespaceDeletions int
}

PatchStats holds the results of analyzing a diff patch

func AnalyzePatch

func AnalyzePatch(patch string) PatchStats

AnalyzePatch analyzes a unified diff patch and returns both raw and meaningful line counts. It parses diff hunks and categorizes each changed line as meaningful, comment, or whitespace.

Jump to

Keyboard shortcuts

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