reviver

package
v0.0.0-...-0f8216c Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0, MIT Imports: 11 Imported by: 3

Documentation

Overview

Package reviver scans the code looking for TODOs and pass them to registered Buggers to ensure TODOs point to active issues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bugger

type Bugger interface {
	Activate(todo *Todo) (bool, error)
}

Bugger interface is called for every TODO found in the code. If it can handle the TODO, it must return true. If it returns false, the next Bugger is called. If no Bugger handles the TODO, it's dropped on the floor.

type GitHubBugger

type GitHubBugger struct {
	// contains filtered or unexported fields
}

GitHubBugger implements Bugger interface for github issues.

func NewGitHubBugger

func NewGitHubBugger(client *github.Client, owner, repo string, dryRun bool) (*GitHubBugger, error)

NewGitHubBugger creates a new GitHubBugger.

func (*GitHubBugger) Activate

func (b *GitHubBugger) Activate(todo *Todo) (bool, error)

Activate implements Bugger.Activate.

type Location

type Location struct {
	Comment string
	File    string
	Line    uint
}

Location saves the location where the TODO was found.

type Reviver

type Reviver struct {
	// contains filtered or unexported fields
}

Reviver scans the given paths for TODOs and calls Buggers to handle them.

func New

func New(paths []string, buggers []Bugger) *Reviver

New create a new Reviver.

func (*Reviver) Run

func (r *Reviver) Run() []error

Run runs. It returns all errors found during processing, it doesn't stop on errors.

type Todo

type Todo struct {
	Issue     string
	Locations []Location
}

Todo represents a unique TODO. There can be several TODOs pointing to the same issue in the code. They are all grouped together.

Jump to

Keyboard shortcuts

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