Skip to content

Contributing to Tweak

Thank you for your interest!

Development Setup

git clone https://github.com/OpenSyntaxHQ/tweak.git
cd tweak
go mod tidy
go generate ./...
go build ./...
go test ./tests/...

Adding a New Processor

  1. Create a file in processors/ implementing the Processor interface:
type MyProcessor struct{}

func (p MyProcessor) Name() string        { return "my-proc" }
func (p MyProcessor) Alias() []string     { return nil }
func (p MyProcessor) Title() string       { return fmt.Sprintf("My Processor (%s)", p.Name()) }
func (p MyProcessor) Description() string { return "Short description" }
func (p MyProcessor) FilterValue() string { return p.Title() }
func (p MyProcessor) Flags() []Flag       { return nil }
func (p MyProcessor) Transform(data []byte, f ...Flag) (string, error) {
    // implementation
}
  1. Register it in processors/all.go.

  2. Add a test in tests/ — see existing files for patterns.

Commit Guidelines

Running Tests

go test -v -race -count=1 ./tests/...

License

By contributing, you agree your contributions will be licensed under the Apache 2.0 License.