workflow

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySourceEdits

func ApplySourceEdits(data []byte, edits []SourceEdit) ([]byte, error)

func AtomicWriteFile

func AtomicWriteFile(path string, data []byte, perm os.FileMode) error

func DiscoverWorkflowFiles

func DiscoverWorkflowFiles(paths []string) ([]string, error)

func RewriteWorkflowBytes

func RewriteWorkflowBytes(data []byte, changes []RewriteChange, opts RewriteOptions) ([]byte, error)

Types

type RewriteChange

type RewriteChange struct {
	Use      UseNode
	Action   actions.ParsedAction
	Decision policy.Decision
}

type RewriteOptions

type RewriteOptions struct {
	WriteMetadataComment bool
}

type SourceEdit

type SourceEdit struct {
	Start       int
	End         int
	Replacement []byte
}

func BuildSourceEdits

func BuildSourceEdits(data []byte, changes []RewriteChange, opts RewriteOptions) ([]SourceEdit, error)

type UseNode

type UseNode struct {
	File          string `json:"file"`
	NodePath      string `json:"node_path"`
	Raw           string `json:"raw"`
	Line          int    `json:"line"`
	Column        int    `json:"column"`
	HeadLine      string `json:"head_line"`
	LineIndex     int    `json:"line_index"`
	InlineComment string `json:"inline_comment,omitempty"`
}

func ExtractUsesFromFile

func ExtractUsesFromFile(file string) ([]UseNode, error)

func ExtractUsesFromFiles

func ExtractUsesFromFiles(files []string) ([]UseNode, error)

Jump to

Keyboard shortcuts

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