utils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const GryphCommandPlaceholder = "__GRYPH_COMMAND__"

Variables

This section is empty.

Functions

func CountDiffLines added in v0.2.7

func CountDiffLines(oldStr, newStr string) (added, removed int)

CountDiffLines computes the number of added and removed lines between old and new strings.

func CountNewFileLines added in v0.2.7

func CountNewFileLines(content string) int

CountNewFileLines counts lines in content for new file creation.

func GenerateDiff

func GenerateDiff(filePath, oldStr, newStr string) string

GenerateDiff produces a unified diff string from old and new content for a given file path.

func GryphCommand added in v0.3.2

func GryphCommand() string

GryphCommand returns the gryph executable command. Currently returns "gryph", assuming it's in PATH.

func HashContent

func HashContent(content string) string

HashContent returns the lowercase hex SHA-256 hash of the given content. Returns an empty string for empty input.

func IsGryphCommand added in v0.3.1

func IsGryphCommand(cmd string) bool

IsGryphCommand checks if a command string is a gryph hook command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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