difftest

package module
v0.0.0-...-b9f5cc8 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: 0BSD Imports: 13 Imported by: 0

README

difftest

Installation

go install gitlab.com/studentmain/difftest/difftest@latest

Usage

Bash:

diff=`difftest`
if [ -z $diff ]; then echo "no change"; exit; fi
go test $diff

Powershell:

$diff = difftest
if (!$diff) {
    Out-Host "no change"
    return
}
go test $diff
Supported parameters

All following parameters are optional.

difftest -directory ./repo -oldrev HEAD~123 -newrev HEAD -skipext txt,md,docx,mod,sum -verbose

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChangedPackage

func GetChangedPackage(dir, oldrev, newrev string, skipext []string) []string

func ParseModfileStr

func ParseModfileStr(b string) *modfile.File

func ParsePackageImport

func ParsePackageImport() map[string][]string

Types

type DiffPair

type DiffPair struct {
	Old *object.Tree
	New *object.Tree
}

func NewDiffPair

func NewDiffPair(path, oldrev, newrev string) *DiffPair

func (*DiffPair) Diff

func (d *DiffPair) Diff() []string

func (*DiffPair) DiffModfile

func (d *DiffPair) DiffModfile() (changedPackages []string, fundamentalChange bool)

type FS

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

func NewFS

func NewFS(path string) *FS

func (*FS) FilterTestablePackage

func (f *FS) FilterTestablePackage(pkgs []string) []string

func (*FS) GetAll

func (f *FS) GetAll() []string

func (*FS) GetChanged

func (f *FS) GetChanged() []string

func (*FS) MarkChangedFile

func (f *FS) MarkChangedFile(rpath string)

func (*FS) MarkChangedPackage

func (f *FS) MarkChangedPackage(pkgpath string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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