Documentation
¶
Overview ¶
internal/codemod/types.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeScript ¶
type ChangeScript []FileChangeSet
ChangeScript is the top-level structure, representing a list of changes for multiple files.
type FileChangeSet ¶
type FileChangeSet struct {
FilePath string `json:"file_path"`
Operations []Operation `json:"operations"`
}
FileChangeSet groups all operations for a single file.
type Operation ¶
type Operation struct {
// Type indicates the kind of operation (e.g., "regex_replace", "add_import").
Type string `json:"type"`
// Description provides a human-readable explanation of the operation.
Description string `json:"description,omitempty"`
// --- Fields for "regex_replace" type ---
// FindRegex is the regular expression to find.
FindRegex string `json:"find_regex,omitempty"`
// ReplaceWith is the string to replace matches with.
ReplaceWith string `json:"replace_with,omitempty"`
// LineNumber can be used to target a specific line for some operations (not used by basic regex_replace yet).
LineNumber *int `json:"line_number,omitempty"`
}
Operation defines a single modification to be performed on a file.
Click to show internal directories.
Click to hide internal directories.