angularcommit

package
Version: v0.0.0-...-8daa82e Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package angularcommit analyzes angular-style commit messages

https://gist.github.com/stephenparish/9941e89d80e2bc58a153#format-of-the-commit-message https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#

Index

Constants

This section is empty.

Variables

View Source
var (

	// DefaultOptions for angular commit Analyzer
	DefaultOptions = &Options{
		ChoreTypes:   []string{"chore", "docs", "test"},
		FixTypes:     []string{"fix", "refactor", "perf", "style"},
		FeatureTypes: []string{"feat"},
		BreakingChangeMarkers: []string{
			`BREAKING\s+CHANGE:`,
			`BREAKING\s+CHANGE`,
			`BREAKING:`,
		},
	}
)

Functions

This section is empty.

Types

type Analyzer

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

Analyzer is a semrel.Analyzer instance that parses commits according to angularjs commit conventions

func New

func New() *Analyzer

New initializes Analyzer with DefaultOptions

func NewWithOptions

func NewWithOptions(options *Options) *Analyzer

NewWithOptions initializes Analyzer with options provided

func (*Analyzer) Analyze

func (analyzer *Analyzer) Analyze(commit *semrel.Commit) ([]semrel.Change, error)

Analyze implements semrel.Analyzer interface for angularcommit.Analyzer

func (*Analyzer) Lint

func (analyzer *Analyzer) Lint(message string) []error

Lint checks if message is fomatted according to rules specified in analyzer. Currently only checs the format of head line and that type is found.

type Change

type Change struct {
	FullHeader      string
	CommitType      string
	Scope           string
	Subject         string
	BreakingMessage string
	Hash            string
	// contains filtered or unexported fields
}

Change captures commit message analysis

func (*Change) BumpLevel

func (commit *Change) BumpLevel() semrel.BumpLevel

BumpLevel implements semrel.Change interface

func (*Change) Category

func (commit *Change) Category() string

Category implements semrel.Change interface

func (*Change) PreReleased

func (commit *Change) PreReleased() bool

PreReleased implements semrel.Change interface

type Options

type Options struct {
	ChoreTypes            []string
	FixTypes              []string
	FeatureTypes          []string
	BreakingChangeMarkers []string
}

Options control how angular commit analyzer behaves

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL