report

package
v54.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPackages

func GetPackages(dir string) ([]string, error)

GetPackages returns all the go sdk packages under the given root directory

Types

type BreakingChanges

type BreakingChanges struct {
	Consts     map[string]delta.Signature    `json:"consts,omitempty"`
	Funcs      map[string]delta.FuncSig      `json:"funcs,omitempty"`
	Interfaces map[string]delta.InterfaceDef `json:"interfaces,omitempty"`
	Structs    map[string]delta.StructDef    `json:"structs,omitempty"`
	Removed    *delta.Content                `json:"removed,omitempty"`
}

BreakingChanges represents a set of breaking changes.

func (BreakingChanges) Count

func (bc BreakingChanges) Count() int

Count returns the count of breaking changes

func (BreakingChanges) IsEmpty

func (bc BreakingChanges) IsEmpty() bool

IsEmpty returns true if there are no breaking changes.

type CommitPkgReport

type CommitPkgReport struct {
	// BreakingChanges includes the commit hashes that contains breaking changes
	BreakingChanges []string `json:"breakingChanges,omitempty"`
	// CommitsReports stores the package report with the key of commit hashes
	CommitsReports map[string]Package `json:"deltas"`
}

CommitPkgReport represents a collection of per-package reports, one for each commit hash

func (CommitPkgReport) HasAdditiveChanges

func (c CommitPkgReport) HasAdditiveChanges() bool

HasAdditiveChanges returns true if the report contains additive changes

func (CommitPkgReport) HasBreakingChanges

func (c CommitPkgReport) HasBreakingChanges() bool

HasBreakingChanges returns true if the report contains breaking changes

func (CommitPkgReport) IsEmpty

func (c CommitPkgReport) IsEmpty() bool

IsEmpty returns true if the report contains no data

type CommitPkgsReport

type CommitPkgsReport struct {
	// AffectedPackages stores the package list with key of commit hashes
	AffectedPackages map[string]PkgsList `json:"affectedPackages"`
	// BreakingChanges stores the commit hashes that contain breaking changes
	BreakingChanges []string `json:"breakingChanges,omitempty"`
	// CommitsReports stores the detailed reports with the key of commit hashes
	CommitsReports map[string]PkgsReport `json:"deltas"`
}

CommitPkgsReport represents a collection of reports, one for each commit hash.

func (CommitPkgsReport) HasAdditiveChanges

func (c CommitPkgsReport) HasAdditiveChanges() bool

HasAdditiveChanges returns true if the package contains additive changes.

func (CommitPkgsReport) HasBreakingChanges

func (c CommitPkgsReport) HasBreakingChanges() bool

HasBreakingChanges returns true if the report contains breaking changes.

func (CommitPkgsReport) IsEmpty

func (c CommitPkgsReport) IsEmpty() bool

IsEmpty returns true if the report contains no data.

func (*CommitPkgsReport) UpdateAffectedPackages

func (c *CommitPkgsReport) UpdateAffectedPackages(commit string, r PkgsReport)

UpdateAffectedPackages updates the collection of affected packages with the packages that were touched in the specified commit

type GenerationOption

type GenerationOption struct {
	// OnlyBreakingChanges ...
	OnlyBreakingChanges bool
	// OnlyAdditiveChanges ...
	OnlyAdditiveChanges bool
}

GenerationOption ...

type ModifiedPackages

type ModifiedPackages map[string]Package

ModifiedPackages contains a collection of package reports, it's structured as "package path":pkgReport

func (ModifiedPackages) HasAdditiveChanges

func (m ModifiedPackages) HasAdditiveChanges() bool

HasAdditiveChanges returns true if any package contained in has an additive change

func (ModifiedPackages) HasBreakingChanges

func (m ModifiedPackages) HasBreakingChanges() bool

HasBreakingChanges returns true if any package contained in has a breaking change

func (ModifiedPackages) IsEmpty

func (m ModifiedPackages) IsEmpty() bool

IsEmpty ...

type Package

type Package struct {
	AdditiveChanges *delta.Content   `json:"additiveChanges,omitempty"`
	BreakingChanges *BreakingChanges `json:"breakingChanges,omitempty"`
}

Package represents a per-package report that contains additive and breaking changes.

func Generate

func Generate(lhs, rhs exports.Content, option *GenerationOption) Package

Generate generates a package report based on the delta between lhs and rhs. onlyBreakingChanges - pass true to include only breaking changes in the report. onlyAdditions - pass true to include only addition changes in the report.

func (Package) HasAdditiveChanges

func (p Package) HasAdditiveChanges() bool

HasAdditiveChanges returns true if the package report contains additive changes.

func (Package) HasBreakingChanges

func (p Package) HasBreakingChanges() bool

HasBreakingChanges returns true if the package report contains breaking changes.

func (Package) IsEmpty

func (p Package) IsEmpty() bool

IsEmpty returns true if the report contains no data (e.g. no changes in exported types).

func (Package) ToMarkdown

func (p Package) ToMarkdown() string

ToMarkdown creates a report of the package changes in markdown format.

type PkgsList

type PkgsList []string

PkgsList contains a collection of packages

type PkgsReport

type PkgsReport struct {
	// AddedPackages stores the added packages in the report
	AddedPackages PkgsList `json:"added,omitempty"`
	// ModifiedPackages stores the details of all modified packages
	ModifiedPackages ModifiedPackages `json:"modified,omitempty"`
	// RemovedPackages stores the removed packages in the report
	RemovedPackages PkgsList `json:"removed,omitempty"`
}

PkgsReport represents a complete report of added, removed, and modified packages

func (PkgsReport) HasAdditiveChanges

func (r PkgsReport) HasAdditiveChanges() bool

HasAdditiveChanges returns true if the package report contains additive changes

func (PkgsReport) HasBreakingChanges

func (r PkgsReport) HasBreakingChanges() bool

HasBreakingChanges returns true if the package report contains breaking changes

func (PkgsReport) IsEmpty

func (r PkgsReport) IsEmpty() bool

IsEmpty returns true if the report contains no data

func (*PkgsReport) ToMarkdown

func (r *PkgsReport) ToMarkdown(version string) string

ToMarkdown writes the report to string in the markdown form. The version parameter if set will output the release history title and the release version header one level beneath it with the value specified. Leave the version parameter empty to output the diff without the release headers.

type Status

type Status interface {
	IsEmpty() bool
	HasBreakingChanges() bool
	HasAdditiveChanges() bool
}

Status ...

Jump to

Keyboard shortcuts

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