codemods

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package codemods provides a set of code modifications (codemods) for modifying files. It allows you to define a set of code modifications and apply them to a directory.

Index

Constants

This section is empty.

Variables

View Source
var Mods = map[string]CodeMod{}

Functions

This section is empty.

Types

type BashFunc

type BashFunc struct{}

func (BashFunc) Apply

func (s BashFunc) Apply(source, target, match string, args ...string) error

func (BashFunc) Description

func (s BashFunc) Description() string

func (BashFunc) Usage

func (s BashFunc) Usage() string

func (BashFunc) Validate

func (s BashFunc) Validate(_, _, _ string, args ...string) error

type CodeMod

type CodeMod interface {
	Apply(source string, target string, match string, args ...string) error
	Validate(source string, target string, match string, args ...string) error
	Description() string
	Usage() string
}

type Inject

type Inject struct{}

func (Inject) Apply

func (s Inject) Apply(source, target, match string, args ...string) error

func (Inject) Description

func (s Inject) Description() string

func (Inject) Usage

func (s Inject) Usage() string

func (Inject) Validate

func (s Inject) Validate(_, _, _ string, args ...string) error

type ReplaceFile

type ReplaceFile struct{}

func (ReplaceFile) Apply

func (s ReplaceFile) Apply(source, target, match string, args ...string) error

func (ReplaceFile) Description

func (s ReplaceFile) Description() string

func (ReplaceFile) Usage

func (s ReplaceFile) Usage() string

func (ReplaceFile) Validate

func (s ReplaceFile) Validate(_, _, _ string, args ...string) error

type SJSON added in v0.1.1

type SJSON struct{}

func (SJSON) Apply added in v0.1.1

func (s SJSON) Apply(source, target, match string, args ...string) error

func (SJSON) Description added in v0.1.1

func (s SJSON) Description() string

func (SJSON) Usage added in v0.1.1

func (s SJSON) Usage() string

func (SJSON) Validate added in v0.1.1

func (s SJSON) Validate(_, _, _ string, args ...string) error

type Sed

type Sed struct{}

func (Sed) Apply

func (s Sed) Apply(source, target, match string, args ...string) error

func (Sed) Description

func (s Sed) Description() string

func (Sed) Usage

func (s Sed) Usage() string

func (Sed) Validate

func (s Sed) Validate(_, _, _ string, args ...string) error

Jump to

Keyboard shortcuts

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